1. Nov 19, 2019
    • Craig Topper's avatar
      [X86] Add AMD Matisse (znver2) model number to getHostCPUName and... · ff75bf6a
      Craig Topper authored
      [X86] Add AMD Matisse (znver2) model number to getHostCPUName and compiler-rt's getAMDProcessorTypeAndSubtype.
      
      This is the CPUID model used on Ryzen 3000 series (Zen 2/Matisse) CPUs.
      
      Patch by Alex James
      
      Differential Revision: https://reviews.llvm.org/D70279
      ff75bf6a
    • Pierre Habouzit's avatar
      Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)) · d4e1ba3f
      Pierre Habouzit authored
      __attribute__((objc_direct)) is an attribute on methods declaration, and
      __attribute__((objc_direct_members)) on implementation, categories or
      extensions.
      
      A `direct` property specifier is added (@property(direct) type name)
      
      These attributes / specifiers cause the method to have no associated
      Objective-C metadata (for the property or the method itself), and the
      calling convention to be a direct C function call.
      
      The symbol for the method has enforced hidden visibility and such direct
      calls are hence unreachable cross image. An explicit C function must be
      made if so desired to wrap them.
      
      The implicit `self` and `_cmd` arguments are preserved, however to
      maintain compatibility with the usual `objc_msgSend` semantics,
      3 fundamental precautions are taken:
      
      1) for instance methods, `self` is nil-checked. On arm64 backends this
         typically adds a single instruction (cbz x0, <closest-ret>) to the
         codegen, for the vast majority of the cases when the return type is a
         scalar.
      
      2) for class methods, because the class may not be realized/initialized
         yet, a call to `[self self]` is emitted. When the proper deployment
         target is used, this is optimized to `objc_opt_self(self)`.
      
         However, long term we might want to emit something better that the
         optimizer can reason about. When inlining kicks in, these calls
         aren't optimized away as the optimizer has no idea that a single call
         is really necessary.
      
      3) the calling convention for the `_cmd` argument is changed: the caller
         leaves the second argument to the call undefined, and the selector is
         loaded inside the body when it's referenced only.
      
      As far as error reporting goes, the compiler refuses:
      - making any overloads direct,
      - making an overload of a direct method,
      - implementations marked as direct when the declaration in the
        interface isn't (the other way around is allowed, as the direct
        attribute is inherited from the declaration),
      - marking methods required for protocol conformance as direct,
      - messaging an unqualified `id` with a direct method,
      - forming any @selector() expression with only direct selectors.
      
      As warnings:
      - any inconsistency of direct-related calling convention when
        @selector() or messaging is used,
      - forming any @selector() expression with a possibly direct selector.
      
      Lastly an `objc_direct_members` attribute is added that can decorate
      `@implementation` blocks and causes methods only declared there (and in
      no `@interface`) to be automatically direct. When decorating an
      `@interface` then all methods and properties declared in this block are
      marked direct.
      
      Radar-ID: rdar://problem/2684889
      Differential Revision: https://reviews.llvm.org/D69991
      Reviewed-By: John McCall
      d4e1ba3f
    • Craig Topper's avatar
      [LegalizeDAG] Convert strict fp nodes to libcalls without losing the chain. · 6e20d70a
      Craig Topper authored
      Previously we mutated the node and then converted it to a libcall. But this loses the chain information.
      
      This patch keeps the chain, but unfortunately breaks tail call optimization as the functions involved in deciding if a node is in tail call position can't handle the chain. But correct ordering seems more important to be right.
      
      Somehow the SystemZ tests improved. I looked at one of them and it seemed that we're handling the split vector elements in a different order and that made the copies work better.
      
      Differential Revision: https://reviews.llvm.org/D70334
      6e20d70a
    • Philip Reames's avatar
      [LoopPred/WC] Use a dominating widenable condition to remove analyze loop exits · ad5a84c8
      Philip Reames authored
      This implements a version of the predicateLoopExits transform from IndVarSimplify extended to exploit widenable conditions - and thus be much wider in scope of legality. The code structure ends up being almost entirely different, so I chose to duplicate this into the LoopPredication pass instead of trying to reuse the code in the IndVars.
      
      The core notions of the transform are as follows:
      
          If we have a widenable condition which controls entry into the loop, we're allowed to widen it arbitrarily. Given that, it's simply a *profitability* question as to what conditions to fold into the widenable branch.
          To avoid pass ordering issues, we want to avoid widening cases that would otherwise be dischargeable. Or... widen in a form which can still be discharged. Thus, we phrase the transform as selecting one analyzeable exit from the set of analyzeable exits to keep. This avoids creating pass ordering complexities.
          Since none of the above proves that we actually exit through our analyzeable exits - we might exit through something else entirely - we limit ourselves to cases where a) the latch is analyzeable and b) the latch is predicted taken, and c) the exit being removed is statically cold.
      
      Differential Revision: https://reviews.llvm.org/D69830
      ad5a84c8
    • Francis Visoiu Mistrih's avatar
      Reland: [Remarks][Driver] Use different remark files when targeting multiple architectures · e15b26fb
      Francis Visoiu Mistrih authored
      When the driver is targeting multiple architectures at once, for things
      like Universal Mach-Os, we need to emit different remark files for each
      cc1 invocation to avoid overwriting the files from a different
      invocation.
      
      For example:
      
      $ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h
      
      will create two remark files:
      
      * foo-x86_64.opt.yaml
      * foo-x86_64h.opt.yaml
      e15b26fb
    • Stefan Pintilie's avatar
      [PowerPC] Test case for vector float gather on ppc64le and ppc64 · 9d938939
      Stefan Pintilie authored
      Test case to verify that the expected code is generated for a
      vector float gather based on the patterns in tablegen for big
      and little endian cases.
      
      Patch by: Kamau Bridgeman
      
      Differential Revision: https://reviews.llvm.org/D69443
      9d938939
    • Reid Kleckner's avatar
      Revert "[Remarks][Driver] Use different remark files when targeting multiple architectures" · 1ff5f0ce
      Reid Kleckner authored
      This reverts commit b4e2b112.
      
      Test doesn't appear to pass on Windows, maybe all non-Mac.
      1ff5f0ce
    • Eric Christopher's avatar
      Temporarily Revert "Add support for options -frounding-math, ftrapping-math,... · 30e7ee3c
      Eric Christopher authored
      Temporarily Revert "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="
      and a follow-up NFC rearrangement as it's causing a crash on valid. Testcase is on the original review thread.
      
      This reverts commits af57dbf1 and e6584b2b
      30e7ee3c
    • Reid Kleckner's avatar
      a77b66a0
    • Francis Visoiu Mistrih's avatar
      [Remarks][Driver] Use different remark files when targeting multiple architectures · b4e2b112
      Francis Visoiu Mistrih authored
      When the driver is targeting multiple architectures at once, for things
      like Universal Mach-Os, we need to emit different remark files for each
      cc1 invocation to avoid overwriting the files from a different
      invocation.
      
      For example:
      
      $ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h
      
      will create two remark files:
      
      * foo-x86_64.opt.yaml
      * foo-x86_64h.opt.yaml
      b4e2b112
    • Yi Kong's avatar
      1689ad27
    • Vedant Kumar's avatar
      [Signal] Allow llvm clients to opt into one-shot SIGPIPE handling · 4624e83c
      Vedant Kumar authored
      Allow clients of the llvm library to opt-in to one-shot SIGPIPE
      handling, instead of forcing them to undo llvm's SIGPIPE handler
      registration (which is brittle).
      
      The current behavior is preserved for all llvm-derived tools (except
      lldb) by means of a default-`true` flag in the InitLLVM constructor.
      
      This prevents "IO error" crashes in long-lived processes (lldb is the
      motivating example) which both a) load llvm as a dynamic library and b)
      *really* need to ignore SIGPIPE.
      
      As llvm signal handlers can be installed when calling into libclang
      (say, via RemoveFileOnSignal), thereby overriding a previous SIG_IGN for
      SIGPIPE, there is no clean way to opt-out of "exit-on-SIGPIPE" in the
      current model.
      
      Differential Revision: https://reviews.llvm.org/D70277
      4624e83c
    • Jon Chesterfield's avatar
      [libomptarget][nfc] Move some source into common from nvptx · 5a4a05d7
      Jon Chesterfield authored
      Summary:
      [libomptarget][nfc] Move some source into common from nvptx
      
      Moves some source that compiles cleanly under amdgcn into a common subdirectory
      Includes some non-trivial files and some headers. Keeps the cuda file extension.
      
      The build systems for different architectures seem unlikely to have much in
      common. The idea is therefore to set include paths such that files under
      common/src compile as if they were under arch/src as the mechanism for sharing.
      In particular, files under common/src need to be able to include target_impl.h.
      
      The corresponding -Icommon is left out in favour of explicit includes on the
      basis that the it makes it clearer which files under common are used by a given
      architecture.
      
      Reviewers: jdoerfert, ABataev, grokos
      
      Reviewed By: ABataev
      
      Subscribers: jfb, mgorny, openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D70328
      5a4a05d7
    • Michael Liao's avatar
      Fix shared lib build. · 17e37ba5
      Michael Liao authored
      17e37ba5
    • Adrian Prantl's avatar
      Replace bitfield in lldb::Type with byte-sized members. (NFC) · d4f18f11
      Adrian Prantl authored
      Due to alginment and packing using separate members takes up the same
      amount of space, but makes it far less cumbersome to deal with it in
      constructors etc.
      d4f18f11
    • Julian Lettner's avatar
      7e4d386b
    • Julian Lettner's avatar
      Bump sanitizer iOS deployment target to 9.0 · 4d4066a5
      Julian Lettner authored
      Bump default value for `-miphoneos-version-min=x` to 9.0 (from 8.0).
      TSan tests that use thread local storage `__thread` (e.g., tls_race.cpp)
      are failing to link for the iOS simulator (arch=x86_64 and
      -miphoneos-version-min=8.0) on internal/master (will be submitted to
      Glacier train):
      ```
      ld: targeted OS version does not support use of thread local variables in _main for architecture x86_64
      ```
      
      iOS 9.0 was released 2015.
      4d4066a5
    • Julian Lettner's avatar
      Bump sanitizer macOS deployment target to 10.10 · b87fc09d
      Julian Lettner authored
      Bump default value for `SANITIZER_MIN_OSX_VERSION` to 10.10 (from 10.9).
      TSan does not work on macOS 10.9 and a nice error message is preferable
      to an "unreferenced symbol" error when loading the TSan runtime.
      
      We could try to only bump the deployment target for TSan, but we would
      have to invest into adding support for this to our CMake build and it
      does not seem worth it.  macOS 10.10 was released in 2014.
      
      rdar://31335781
      b87fc09d
    • Jonas Devlieghere's avatar
      [Docs] Add Python caveats under the development section · 0aed6486
      Jonas Devlieghere authored
      This adds a page named Caveats with a section on some of the things to
      be aware of related to Python. It's a question we've seen more than once
      pop up and I think it's good to have it documentation on the website.
      Even though some of it might be useful to users, I still put it under
      "development" because it requires some understanding of how LLDB is
      built.
      
      Differential revision: https://reviews.llvm.org/D70252
      0aed6486
    • Fangrui Song's avatar
      [yaml2obj][test] Move tests to binary format specific subdirectories · 63f0f54c
      Fangrui Song authored
      Create COFF/, ELF/, and Minidump and move tests there.
      
      Also
      
      * Rename `*.test` to `*.yaml`
      * For yaml2obj RUN lines, use `-o %t` instead of `> %t` for consistency.
        We still have tests that check stdout is the default output, e.g.
        multi-doc.test
      * Update tests to consistently use `##` for comments.
        `#` is for RUN and CHECK lines.
      * Merge symboless-relocation.yaml and invalid-symboless-relocation.yaml to ELF/relocation-implicit-symbol-index.test
      
      Reviewed By: grimar, jhenderson
      
      Differential Revision: https://reviews.llvm.org/D70264
      63f0f54c
    • Joel E. Denny's avatar
      [Attr] Fix `-ast-print` for `asm` attribute · c85fa79d
      Joel E. Denny authored
      Without this fix, the tests introduced here produce the following
      assert fail:
      
      ```
      clang: /home/jdenny/llvm/clang/include/clang/Basic/AttributeCommonInfo.h:163: unsigned int clang::AttributeCommonInfo::getAttributeSpellingListIndex() const: Assertion `(isAttributeSpellingListCalculated() || AttrName) && "Spelling cannot be found"' failed.
      ```
      
      The bug was introduced by D67368, which caused `AsmLabelAttr`'s
      spelling index to be set to `SpellingNotCalculated`.
      
      Reviewed By: aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D70349
      c85fa79d
    • Francesco Petrogalli's avatar
      [dwarfgen] Fix initialization order error. [NFCI] · 015b2e69
      Francesco Petrogalli authored
      This commit fixes the `-Werror=reorder` builds.
      015b2e69
    • Alexey Bataev's avatar
      [OPENMP50]Fix PR44024: runtime assert in distribute construct. · c3eded06
      Alexey Bataev authored
      If the code is emitted for distribute construct, the nonmonotonic
      modifier should not be added.
      c3eded06
    • Julian Lettner's avatar
      [ASan] Mark test as UNSUPPORTED for iOS simulator · b0567be2
      Julian Lettner authored
      coverage-fork.cpp uses `fork()` which requires additional permissions
      in the iOS simulator sandbox.  We cannot use `sandbox-exec` to grant
      these permissions since this is a Posix (not Darwin) test.
      b0567be2
  2. Nov 18, 2019