1. Nov 01, 2019
    • Simon Atanasyan's avatar
      [utils] Reflow asm check generation to tolerate blank lines · a8a89c77
      Simon Atanasyan authored
      This change introduces two fixes. The second fix allows to generate
      a test to check the first fix.
      
      - Output `CHECK-EMPTY` prefix for an empty line in ASM output. Before that
        fix `update_llc_test_checks.py` incorrectly emits `CHECK-NEXT: <space>`
        prefix.
      - Fix the `ASM_FUNCTION_MIPS_RE` regex to stop on a real function
        epilogue not on an inline assembler prologue and include inline
        assembler code into a test.
      
      Differential Revision: https://reviews.llvm.org/D47192
      a8a89c77
    • Matt Arsenault's avatar
      DAG: Add DAG argument to isFPExtFoldable · 62217670
      Matt Arsenault authored
      For AMDGPU this is dependent on the FP mode, which should eventually
      not be a property of the subtarget.
      62217670
    • Thomas Lively's avatar
      [WebAssembly] SIMD integer min and max instructions · a07019a2
      Thomas Lively authored
      Summary:
      Introduces a clang builtins and LLVM intrinsics representing integer
      min/max instructions. These instructions have not been merged to the
      SIMD spec proposal yet, so they are currently opt-in only via builtins
      and not produced by general pattern matching. If these instructions
      are accepted into the spec proposal the builtins and intrinsics will
      be replaced with normal pattern matching.
      
      Defined in https://github.com/WebAssembly/simd/pull/27.
      
      Reviewers: aheejin
      
      Reviewed By: aheejin
      
      Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D69696
      a07019a2
    • Matt Arsenault's avatar
      Fix update_mir_test_checks after 3598b810 · 10c1d0a4
      Matt Arsenault authored
      10c1d0a4
    • Matt Arsenault's avatar
      clang: Fix assert on void pointer arithmetic with address_space · c6da9ec0
      Matt Arsenault authored
      This attempted to always use the default address space void pointer
      type instead of preserving the source address space.
      c6da9ec0
    • Thomas Lively's avatar
      Reland "[WebAssembly] Handle multiple loads of splatted loads" · 3479fd25
      Thomas Lively authored
      This reverts commit 92a25fbf and fixes
      the ambiguous method call that was causing build failures.
      3479fd25
    • Heejin Ahn's avatar
      [clang][driver] Add ProfileData to LLVM_LINK_COMPONENTS · b9903ec8
      Heejin Ahn authored
      Summary:
      After D68351 we need this to make builds with `-DBUILD_SHARED_LIB=ON`
      work.
      
      Reviewers: tlively
      
      Subscribers: mgorny, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69699
      b9903ec8
    • Yaxun (Sam) Liu's avatar
      [CodeGen] Fix invalid llvm.linker.options about pragma detect_mismatch · bb1616ba
      Yaxun (Sam) Liu authored
      When a target does not support pragma detect_mismatch, an llvm.linker.options
      metadata with an empty entry is created, which causes diagnostic in backend
      since backend expects name/value pair in llvm.linker.options entries.
      
      This patch fixes that.
      
      Differential Revision: https://reviews.llvm.org/D69678
      bb1616ba
    • JonChesterfield's avatar
      [nfc][omptarget] Use builtin var abstraction. Second pass at D69476 · 9b06ac98
      JonChesterfield authored
      Summary:
      [nfc][omptarget] Use builtin var abstraction. Second pass at D69476
      
      Use the wrappers in support.h for cuda builtin variables at all call sites.
      Localises use of cuda and removes WARPSIZE==32 assumption in debug.h.
      
      Reviewers: ABataev, jdoerfert, grokos
      
      Reviewed By: jdoerfert
      
      Subscribers: openmp-commits
      
      Tags: #openmp
      
      Differential Revision: https://reviews.llvm.org/D69693
      9b06ac98
    • Vedant Kumar's avatar
      [profile] Fifth speculative fix for Android after D68351 · 197bad50
      Vedant Kumar authored
      Use the printf macros from inttypes.h to sidestep -Wformat issues:
      
      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c:425:14: error: format specifies type 'long long' but the argument has type 'off_t' (aka 'long') [-Werror,-Wformat]
                   CurrentFileOffset, PageSize);
                   ^~~~~~~~~~~~~~~~~
      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/lib/profile/InstrProfilingPort.h:114:50: note: expanded from macro 'PROF_ERR'
        fprintf(stderr, "LLVM Profile Error: " Format, __VA_ARGS__);
                                               ~~~~~~  ^~~~~~~~~~~
      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c:461:41: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat]
              strerror(errno), CountersBegin, PageAlignedCountersLength, Fileno,
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~
      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/lib/profile/InstrProfilingPort.h:114:50: note: expanded from macro 'PROF_ERR'
        fprintf(stderr, "LLVM Profile Error: " Format, __VA_ARGS__);
                                               ~~~~~~  ^~~~~~~~~~~
      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/lib/profile/InstrProfilingFile.c:462:9: error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat]
              FileOffsetToCounters);
              ^~~~~~~~~~~~~~~~~~~~
      /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm-project/compiler-rt/lib/profile/InstrProfilingPort.h:114:50: note: expanded from macro 'PROF_ERR'
        fprintf(stderr, "LLVM Profile Error: " Format, __VA_ARGS__);
      197bad50
    • Vlad Tsyrklevich's avatar
      Revert "[WebAssembly] Handle multiple loads of splatted loads" · 92a25fbf
      Vlad Tsyrklevich authored
      This reverts commit 2ab1b8c1, it is
      causing build failures on numerous bots, including
      sanitizer-x86_64-linux-bootstrap-ubsan. My previous revert was for the
      wrong commit.
      92a25fbf
    • Vedant Kumar's avatar
      [profile] Fourth fix for toolchains without zlib after D68351 · fd3d4500
      Vedant Kumar authored
      Fix llvm/test/tools/llvm-profdata/nocompress.test, which I missed when
      authoring D68351 because my toolchain is configured with zlib support.
      fd3d4500
    • Vlad Tsyrklevich's avatar
      Revert "[WebAssembly] Expand setcc of v2i64" · e5cae569
      Vlad Tsyrklevich authored
      This reverts commit 11850a63, it was
      causing build failures on numerous bots, including
      sanitizer-x86_64-linux-bootstrap-ubsan.
      e5cae569
    • Vedant Kumar's avatar
      [profile] Third speculative fix for Windows after D68351 · a49795d8
      Vedant Kumar authored
      _putenv on Windows takes 1 argument, whereas setenv elsewhere takes 3.
      Just treat the two platforms differently.
      
      http://lab.llvm.org:8011/builders/sanitizer-windows/builds/53547
      a49795d8
    • Vedant Kumar's avatar
      [profile] Second speculative fix for Windows · 6dfe8e59
      Vedant Kumar authored
      VLAs in C appear to not work on Windows, so use COMPILER_RT_ALLOCA:
      
      C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\profile\InstrProfilingWriter.c(264): error C2057: expected constant expression
      C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\profile\InstrProfilingWriter.c(264): error C2466: cannot allocate an array of constant size 0
      C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\lib\profile\InstrProfilingWriter.c(264): error C2133: 'Zeroes': unknown size
      6dfe8e59
    • Vedant Kumar's avatar
    • LLVM GN Syncbot's avatar
      gn build: Merge e72e59e9 · bbbd22e6
      LLVM GN Syncbot authored
      bbbd22e6
    • Nico Weber's avatar
      Revert "[X86] add mayRaiseFPException flag and FPCW registers for X87 instructions" · a5bf48b8
      Nico Weber authored
      This reverts commit a678677d.
      It broke CodeGen/ms-inline-asm.c on most bots.
      a5bf48b8
    • Vedant Kumar's avatar
      [profile] Add a mode to continuously sync counter updates to a file · d889d1ef
      Vedant Kumar authored
      Add support for continuously syncing profile counter updates to a file.
      
      The motivation for this is that programs do not always exit cleanly. On
      iOS, for example, programs are usually killed via a signal from the OS.
      Running atexit() handlers after catching a signal is unreliable, so some
      method for progressively writing out profile data is necessary.
      
      The approach taken here is to mmap() the `__llvm_prf_cnts` section onto
      a raw profile. To do this, the linker must page-align the counter and
      data sections, and the runtime must ensure that counters are mapped to a
      page-aligned offset within a raw profile.
      
      Continuous mode is (for the moment) incompatible with the online merging
      mode. This limitation is lifted in https://reviews.llvm.org/D69586.
      
      Continuous mode is also (for the moment) incompatible with value
      profiling, as I'm not sure whether there is interest in this and the
      implementation may be tricky.
      
      As I have not been able to test extensively on non-Darwin platforms,
      only Darwin support is included for the moment. However, continuous mode
      may "just work" without modification on Linux and some UNIX-likes. AIUI
      the default value for the GNU linker's `--section-alignment` flag is set
      to the page size on many systems. This appears to be true for LLD as
      well, as its `no_nmagic` option is on by default. Continuous mode will
      not "just work" on Fuchsia or Windows, as it's not possible to mmap() a
      section on these platforms. There is a proposal to add a layer of
      indirection to the profile instrumentation to support these platforms.
      
      rdar://54210980
      
      Differential Revision: https://reviews.llvm.org/D68351
      d889d1ef
    • Vedant Kumar's avatar
    • Adrian Prantl's avatar
      9370a741
    • Francis Visoiu Mistrih's avatar
      [Remarks] Fix error message check in unit test · 6b82988f
      Francis Visoiu Mistrih authored
      Always compare using lowercase to support multiple platforms.
      6b82988f
    • Peter Collingbourne's avatar
      gn build: Add support for cross-compiling the builtins and profile runtimes... · 7c86c70f
      Peter Collingbourne authored
      gn build: Add support for cross-compiling the builtins and profile runtimes for Android aarch64 and arm.
      
      Differential Revision: https://reviews.llvm.org/D69681
      7c86c70f
    • Francis Visoiu Mistrih's avatar
      [Remarks] Add support for linking remarks · e72e59e9
      Francis Visoiu Mistrih authored
      Remarks are usually emitted per-TU, and for generating a standalone
      remark file that can be shipped with the linked binary we need some kind
      of tool to merge everything together.
      
      The remarks::RemarkLinker class takes care of this and:
      
      * Deduplicates remarks
      * Filters remarks with no debug location
      * Merges string tables from all the entries
      
      As an output, it provides an iterator range that can be used to
      serialize the remarks to a file.
      
      Differential Revision: https://reviews.llvm.org/D69141
      e72e59e9
    • Reid Kleckner's avatar
    • Reid Kleckner's avatar
      7ac4c317
    • Craig Topper's avatar
      [LV] Add test case that was supposed to go with D67948 · f8ba90d4
      Craig Topper authored
      I forgot to git add it when I committed for Evgeniy.
      f8ba90d4
    • Craig Topper's avatar
      [X86] add mayRaiseFPException flag and FPCW registers for X87 instructions · a678677d
      Craig Topper authored
      This patch adds flag "mayRaiseFPException" , FPCW and FPSW for X87 instructions which could raise
      float exception.
      
      Patch by LiuChen. With a couple small fixes from me.
      
      Differential Revision: https://reviews.llvm.org/D68854
      a678677d
    • Thomas Lively's avatar
      [WebAssembly] Handle multiple loads of splatted loads · 2ab1b8c1
      Thomas Lively authored
      Summary:
      Fixes an ISel failure when a splatted load is used more than once. The
      failure was due to the hacks we were doing in ISel lowering to
      preserve the original load as the operand of a LOAD_SPLAT node. The
      fix is to properly lower the splatted use of the load to a separate
      LOAD_SPLAT node.
      
      Reviewers: aheejin
      
      Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69640
      2ab1b8c1
    • Evandro Menezes's avatar
      [mca] Fix test case (NFC) · 80c03fb5
      Evandro Menezes authored
      Fix test case for Darwin builds.
      80c03fb5
    • Kostya Kortchinsky's avatar
      [scudo][standalone] Fix Secondary bug w/ freelist · c7bc3db2
      Kostya Kortchinsky authored
      Summary:
      cferris@ found an issue due to the new Secondary free list behavior
      and unfortunately it's completely my fault. The issue is twofold:
      
      - I lost track of the (major) fact that the Combined assumes that
        all chunks returned by the Secondary are zero'd out apprioriately
        when dealing with `ZeroContents`. With the introduction of the
        freelist, it's no longer the case as there can be a small portion
        of memory between the header and the next page boundary that is
        left untouched (the rest is zero'd via release). So the next time
        that block is returned, it's not fully zero'd out.
      - There was no test that would exercise that behavior :(
      
      There are several ways to fix this, the one I chose makes the most
      sense to me: we pass `ZeroContents` to the Secondary's `allocate`
      and it zero's out the block if requested and it's coming from the
      freelist. The prevents an extraneous `memset` in case the block
      comes from `map`. Another possbility could have been to `memset`
      in `deallocate`, but it's probably overzealous as all secondary
      blocks don't need to be zero'd out.
      
      Add a test that would have found the issue prior to fix.
      
      Reviewers: morehouse, hctim, cferris, pcc, eugenis, vitalybuka
      
      Subscribers: #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D69675
      c7bc3db2
    • Nathan Ridge's avatar
      Refactor getDeclAtPosition() to use SelectionTree + targetDecl() · b6429cdd
      Nathan Ridge authored
      Summary: This fixes issue #163, among other improvements to go-to-definition.
      
      Reviewers: sammccall
      
      Subscribers: jkorous, mgrang, arphaman, kadircet, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D69237
      b6429cdd
    • Nikita Popov's avatar
      [CVP] Add tests for icmp on local ranges; NFC · 2f8a43e1
      Nikita Popov authored
      We currently don't simplify these, because getPredicateAt() does
      not use block values.
      2f8a43e1
    • Nikita Popov's avatar
      [LVI] Regenerate test checks; NFC · 1cfe3e6d
      Nikita Popov authored
      1cfe3e6d
    • Thomas Lively's avatar
      [WebAssembly] Expand setcc of v2i64 · 11850a63
      Thomas Lively authored
      Summary:
      The SIMD spec does not include i64x2 comparisons, so they need to be
      expanded. Using setOperationAction to expand them also causes f64x2
      comparisons to be expanded, so setCondCodeAction needs to be used
      instead. But since there are no legal condition codes, the legalizer
      does not know how to expand the comparisons. We therefore manually
      unroll the operation, taking care to fill each lane with -1 or 0
      rather than 1 or 0 for consistency with the other vector comparisons.
      
      Reviewers: aheejin
      
      Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69604
      11850a63
    • Michael Spencer's avatar
      [clang][ScanDeps] Fix issue with multiple commands with the same input. · d816d9bd
      Michael Spencer authored
      Previously, given a CompilationDatabase with two commands for the same
      source file we would report that file twice with the union of the
      dependencies for each command both times.
      
      This was due to the way `ClangTool` runs actions given an input source
      file (see the comment in `DependencyScanningTool.cpp`). This commit adds
      a `SingleCommandCompilationDatabase` that is created with each
      `CompileCommand` in the original CDB, which is then used for each
      `ClangTool` invocation. This gives us a single run of
      `DependencyScanningAction` per `CompileCommand`.
      
      I looked at using `AllTUsToolExecutor` which is a parallel tool
      executor, but I'm not sure it's suitable for `clang-scan-deps` as it
      does a lot more sharing of state than `AllTUsToolExecutor` expects.
      
      Differential Revision: https://reviews.llvm.org/D69643
      d816d9bd
    • Reid Kleckner's avatar
      Remove unneeded template alias, causes issues with some MSVC version · 19f1dc7b
      Reid Kleckner authored
      I built locally with the latest MSVC in c++14 and c++17, but it does not
      complain for me. Osman Zakir on llvm-dev reports that they run into
      compile errors here.
      
      In any case, it seems prefereable to reuse clang's LLVM.h header to
      bring in llvm::Optional and Expected.
      19f1dc7b
    • Alex Richardson's avatar
      [update_cc_test_checks.py] Pass the builtin include dir to clang · d9cc7d14
      Alex Richardson authored
      Summary:
      This is required to update tests that make use of builtin headers. To fix
      this use the same command expansion as lit does for %clang_cc1. I tested
      this by updating clang/test/CodeGen/arm-mve-intrinsics/scalar-shifts.c.
      %clang_cc1 will now expand to `clang -cc1 -internal-isystem
      $LLVM_BUILD/lib/clang/$VERSION/include -nostdsysteminc`.
      
      Reviewers: MaskRay
      
      Reviewed By: MaskRay
      
      Subscribers: kristof.beyls, dmgreen, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69611
      d9cc7d14
    • Alex Richardson's avatar
      [compiler-rt] Use xcrun instead of xcodebuild to find the SDK directory · 8baedb82
      Alex Richardson authored
      Summary:
      xcodebuild does not work unless XCode is installed whereas xcrun also work
      when only the Command Line Tools are installed. Unlike the check for the
      version (D69610), this did not cause an erro for me since the fallback to
      /usr/include for the OSX sysroot worked.
      
      Reviewers: yln, delcypher
      
      Reviewed By: yln
      
      Subscribers: dberris, mgorny, #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D69659
      8baedb82
    • Alex Richardson's avatar
      Fix compiler-rt build on macOS without XCode · 52beec76
      Alex Richardson authored
      Summary:
      Starting with 8a5bfbe6 (D68292) this file
      unconditionally uses xcodebuild to get the SDK version. On my system this
      always fails with
      `xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance`
      
      Reviewers: delcypher, yln
      
      Reviewed By: delcypher, yln
      
      Subscribers: dberris, mgorny, #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D69610
      52beec76