1. Aug 15, 2020
    • Xiangling Liao's avatar
      [AIX] Generate unique module id based on Pid and timestamp · f759b4e4
      Xiangling Liao authored
      A unique module id, which is a part of sinit and sterm function names, is
      necessary to be unique. However, `getUniqueModuleId` will fail if there is
      no strong external symbol within a module. We turn to use Pid and timestamp
      when this happens.
      
      Differential Revision: https://reviews.llvm.org/D85527
      f759b4e4
    • Sanjay Patel's avatar
      4abcf7e8
    • Artem Belevich's avatar
      Split Preprocessor/init.c test · 1689c36b
      Artem Belevich authored
      Some parts of the test had been extracted into separate files previously.
      This patch continues the trend and extracts few more large blocks.
      
      This reduces wall time for the test from a single 14s-long test into a set of
      smaller tests that can be run in parallel.
      
      Before/after state of the check-clang tests are here:
      https://gist.github.com/Artem-B/d0b05c2e98a49158c02de23f7f4f0279
      
      Differential Revision: https://reviews.llvm.org/D85798
      1689c36b
    • Michael Park's avatar
      [libcxx/variant] Introduce `switch`-based mechanism for `std::visit`. · a175a965
      Michael Park authored
      This patch introduces mechanism for `std::visit` backed by `switch`.
      The `switch` is structured such that it's a flattened manual vtable (an n-ary array).
      The `switch` mechanism is enabled if `(1 * ... * vs.size()) < 1024`.
      
      The following are performance numbers from the benchmarks added in D85419, tested on my 2017 Macbook Pro.
      
      ```
      $ ./projects/libcxx/benchmarks/variant_visit_1.libcxx.out
      2020-08-09 23:55:14
      Running ./projects/libcxx/benchmarks/variant_visit_1.libcxx.out
      Run on (8 X 3100 MHz CPU s)
      CPU Caches:
        L1 Data 32K (x4)
        L1 Instruction 32K (x4)
        L2 Unified 262K (x4)
        L3 Unified 8388K (x1)
      Load Average: 2.03, 2.36, 2.43
      ------------------------------------------------------------
      Benchmark                 Time             CPU   Iterations
      ------------------------------------------------------------
      BM_Visit<1, 1>        0.260 ns        0.260 ns   1000000000
      BM_Visit<1, 2>         1.56 ns         1.56 ns    435925220
      BM_Visit<1, 3>         1.55 ns         1.55 ns    444416228
      BM_Visit<1, 4>         1.57 ns         1.57 ns    427951336
      BM_Visit<1, 5>         1.57 ns         1.56 ns    444766371
      BM_Visit<1, 6>         1.70 ns         1.68 ns    446639358
      BM_Visit<1, 7>         1.64 ns         1.64 ns    400441630
      BM_Visit<1, 8>         1.56 ns         1.56 ns    430729471
      BM_Visit<1, 9>         1.58 ns         1.58 ns    449894596
      BM_Visit<1, 10>        1.54 ns         1.54 ns    449660506
      BM_Visit<1, 20>        1.56 ns         1.56 ns    450813074
      BM_Visit<1, 30>        1.59 ns         1.59 ns    440032940
      BM_Visit<1, 40>        1.59 ns         1.59 ns    443731656
      BM_Visit<1, 50>        1.56 ns         1.56 ns    444709859
      BM_Visit<1, 60>        1.59 ns         1.58 ns    439527320
      BM_Visit<1, 70>        1.57 ns         1.57 ns    438450890
      BM_Visit<1, 80>        1.58 ns         1.58 ns    443001525
      BM_Visit<1, 90>        1.63 ns         1.62 ns    448456349
      BM_Visit<1, 100>       1.57 ns         1.57 ns    445740630
      
      $ ./projects/libcxx/benchmarks/variant_visit_2.libcxx.out
      2020-08-09 23:59:35
      Running ./projects/libcxx/benchmarks/variant_visit_2.libcxx.out
      Run on (8 X 3100 MHz CPU s)
      CPU Caches:
        L1 Data 32K (x4)
        L1 Instruction 32K (x4)
        L2 Unified 262K (x4)
        L3 Unified 8388K (x1)
      Load Average: 1.40, 1.94, 2.22
      -----------------------------------------------------------
      Benchmark                Time             CPU   Iterations
      -----------------------------------------------------------
      BM_Visit<2, 1>       0.261 ns        0.260 ns   1000000000
      BM_Visit<2, 2>        1.55 ns         1.54 ns    432844219
      BM_Visit<2, 3>        1.30 ns         1.30 ns    532529974
      BM_Visit<2, 4>        1.54 ns         1.54 ns    446055910
      BM_Visit<2, 5>        1.31 ns         1.31 ns    531099680
      BM_Visit<2, 6>        1.56 ns         1.56 ns    443203475
      BM_Visit<2, 7>        1.29 ns         1.29 ns    526478087
      BM_Visit<2, 8>        1.56 ns         1.56 ns    439000834
      BM_Visit<2, 9>        1.30 ns         1.30 ns    528756817
      BM_Visit<2, 10>       1.56 ns         1.55 ns    442923039
      BM_Visit<2, 20>       1.35 ns         1.35 ns    517021072
      BM_Visit<2, 30>       1.60 ns         1.59 ns    419724661
      BM_Visit<2, 40>       1.45 ns         1.44 ns    472137163
      BM_Visit<2, 50>       1.65 ns         1.65 ns    421389743
      
      $ ./projects/libcxx/benchmarks/variant_visit_3.libcxx.out
      2020-08-10 00:01:32
      Running ./projects/libcxx/benchmarks/variant_visit_3.libcxx.out
      Run on (8 X 3100 MHz CPU s)
      CPU Caches:
        L1 Data 32K (x4)
        L1 Instruction 32K (x4)
        L2 Unified 262K (x4)
        L3 Unified 8388K (x1)
      Load Average: 2.20, 2.01, 2.21
      -----------------------------------------------------------
      Benchmark                Time             CPU   Iterations
      -----------------------------------------------------------
      BM_Visit<3, 1>       0.272 ns        0.271 ns   1000000000
      BM_Visit<3, 2>        1.87 ns         1.86 ns    361858090
      BM_Visit<3, 3>        1.77 ns         1.77 ns    391192579
      BM_Visit<3, 4>        1.84 ns         1.84 ns    374694223
      BM_Visit<3, 5>        1.75 ns         1.75 ns    408270392
      BM_Visit<3, 6>        1.88 ns         1.88 ns    378759185
      BM_Visit<3, 7>        1.79 ns         1.79 ns    395498102
      BM_Visit<3, 8>        1.85 ns         1.85 ns    371660366
      BM_Visit<3, 9>        1.80 ns         1.80 ns    386872851
      BM_Visit<3, 10>       1.84 ns         1.84 ns    362367606
      BM_Visit<3, 15>       1.77 ns         1.77 ns    392060220
      BM_Visit<3, 20>       1.85 ns         1.85 ns    379157188
      ```
      
      ```
      $ ./projects/libcxx/benchmarks/variant_visit_1.libcxx.out
      2020-08-10 00:05:57
      Running ./projects/libcxx/benchmarks/variant_visit_1.libcxx.out
      Run on (8 X 3100 MHz CPU s)
      CPU Caches:
        L1 Data 32K (x4)
        L1 Instruction 32K (x4)
        L2 Unified 262K (x4)
        L3 Unified 8388K (x1)
      Load Average: 2.27, 2.36, 2.34
      ------------------------------------------------------------
      Benchmark                 Time             CPU   Iterations
      ------------------------------------------------------------
      BM_Visit<1, 1>        0.271 ns        0.271 ns   1000000000
      BM_Visit<1, 2>        0.269 ns        0.269 ns   1000000000
      BM_Visit<1, 3>        0.271 ns        0.271 ns   1000000000
      BM_Visit<1, 4>        0.270 ns        0.270 ns   1000000000
      BM_Visit<1, 5>        0.269 ns        0.269 ns   1000000000
      BM_Visit<1, 6>        0.270 ns        0.269 ns   1000000000
      BM_Visit<1, 7>        0.265 ns        0.265 ns   1000000000
      BM_Visit<1, 8>        0.269 ns        0.269 ns   1000000000
      BM_Visit<1, 9>        0.268 ns        0.268 ns   1000000000
      BM_Visit<1, 10>       0.269 ns        0.269 ns   1000000000
      BM_Visit<1, 20>       0.267 ns        0.267 ns   1000000000
      BM_Visit<1, 30>       0.272 ns        0.272 ns   1000000000
      BM_Visit<1, 40>       0.268 ns        0.268 ns   1000000000
      BM_Visit<1, 50>       0.268 ns        0.268 ns   1000000000
      BM_Visit<1, 60>       0.268 ns        0.268 ns   1000000000
      BM_Visit<1, 70>       0.269 ns        0.269 ns   1000000000
      BM_Visit<1, 80>       0.266 ns        0.266 ns   1000000000
      BM_Visit<1, 90>       0.268 ns        0.268 ns   1000000000
      BM_Visit<1, 100>      0.267 ns        0.267 ns   1000000000
      
      $ ./projects/libcxx/benchmarks/variant_visit_2.libcxx.out
      2020-08-12 04:09:59
      Running ./projects/libcxx/benchmarks/variant_visit_2.libcxx.out
      Run on (8 X 3100 MHz CPU s)
      CPU Caches:
        L1 Data 32K (x4)
        L1 Instruction 32K (x4)
        L2 Unified 262K (x4)
        L3 Unified 8388K (x1)
      Load Average: 2.17, 4.20, 4.78
      -----------------------------------------------------------
      Benchmark                Time             CPU   Iterations
      -----------------------------------------------------------
      BM_Visit<2, 1>       0.302 ns        0.301 ns   1000000000
      BM_Visit<2, 2>       0.297 ns        0.295 ns   1000000000
      BM_Visit<2, 3>       0.353 ns        0.351 ns   1000000000
      BM_Visit<2, 4>       0.276 ns        0.276 ns   1000000000
      BM_Visit<2, 5>       0.285 ns        0.283 ns   1000000000
      BM_Visit<2, 6>       0.290 ns        0.287 ns   1000000000
      BM_Visit<2, 7>       0.282 ns        0.280 ns   1000000000
      BM_Visit<2, 8>       0.290 ns        0.287 ns   1000000000
      BM_Visit<2, 9>       0.291 ns        0.285 ns   1000000000
      BM_Visit<2, 10>      0.293 ns        0.287 ns   1000000000
      BM_Visit<2, 20>       1.70 ns         1.68 ns    391400375
      BM_Visit<2, 30>       1.64 ns         1.63 ns    418925874
      BM_Visit<2, 40>       1.63 ns         1.62 ns    423623677
      BM_Visit<2, 50>       1.68 ns         1.67 ns    411687212
      
      $ ./projects/libcxx/benchmarks/variant_visit_3.libcxx.out
      2020-08-12 04:10:43
      Running ./projects/libcxx/benchmarks/variant_visit_3.libcxx.out
      Run on (8 X 3100 MHz CPU s)
      CPU Caches:
        L1 Data 32K (x4)
        L1 Instruction 32K (x4)
        L2 Unified 262K (x4)
        L3 Unified 8388K (x1)
      Load Average: 1.57, 3.76, 4.59
      -----------------------------------------------------------
      Benchmark                Time             CPU   Iterations
      -----------------------------------------------------------
      BM_Visit<3, 1>       0.271 ns        0.270 ns   1000000000
      BM_Visit<3, 2>       0.344 ns        0.334 ns   1000000000
      BM_Visit<3, 3>       0.347 ns        0.336 ns   1000000000
      BM_Visit<3, 4>       0.300 ns        0.296 ns   1000000000
      BM_Visit<3, 5>       0.290 ns        0.286 ns   1000000000
      BM_Visit<3, 6>       0.272 ns        0.271 ns   1000000000
      BM_Visit<3, 7>        1.72 ns         1.71 ns    415765841
      BM_Visit<3, 8>        1.73 ns         1.72 ns    408909555
      BM_Visit<3, 9>        2.16 ns         2.04 ns    380898485
      BM_Visit<3, 10>       2.45 ns         2.40 ns    295714256
      BM_Visit<3, 15>       1.92 ns         1.85 ns    375990332
      BM_Visit<3, 20>       1.66 ns         1.65 ns    414456233
      ```
      
      Differential Revision: https://reviews.llvm.org/D85420
      a175a965
    • Vitaly Buka's avatar
      [StackSafety] Use ValueInfo in ParamAccess::Call · fc4fd898
      Vitaly Buka authored
      This avoid GUID lookup in Index.findSummaryInModule.
      Follow up for D81242.
      
      Reviewed By: tejohnson
      
      Differential Revision: https://reviews.llvm.org/D85269
      fc4fd898
    • cgyurgyik's avatar
      79ce64ea
    • Greg McGary's avatar
      [lld-macho] Emit load command LC_BUILD_VERSION · 537f5483
      Greg McGary authored
      Reviewed By: int3
      
      Differential Revision: https://reviews.llvm.org/D85786
      537f5483
    • Greg McGary's avatar
      [MachO] Add skeletal support for DriverKit platform · eef41efe
      Greg McGary authored
      Define the platform ID = 10, and simple mappings between platform ID & name.
      
      Reviewed By: MaskRay, cishida
      
      Differential Revision: https://reviews.llvm.org/D85594
      eef41efe
    • Marius Brehler's avatar
      Test commit · 36f524f4
      Marius Brehler authored
      Test commit access to the LLVM repository.
      36f524f4
    • Mauricio Sifontes's avatar
      Fix warning caused by ReductionTreePass class · c26ed5c9
      Mauricio Sifontes authored
      Explicitly declare ReductionTreeBase base class in ReductionTreePass copy constructor.
      
      Reviewed By: mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D85983
      c26ed5c9
    • Sameer Arora's avatar
      [llvm-libtool-darwin] Add support for -l and -L · 1aed1e72
      Sameer Arora authored
      Add support for passing in libraries via `-l` and `-L` options to
      `llvm-libtool-darwin`.
      
      Reviewed by jhenderson, smeenai
      
      Differential Revision: https://reviews.llvm.org/D85540
      1aed1e72
    • Matt Morehouse's avatar
      [DFSan] Don't unmap during dfsan_flush(). · bb3a3da3
      Matt Morehouse authored
      Unmapping and remapping is dangerous since another thread could touch
      the shadow memory while it is unmapped.  But there is really no need to
      unmap anyway, since mmap(MAP_FIXED) will happily clobber the existing
      mapping with zeroes.  This is thread-safe since the mmap() is done under
      the same kernel lock as page faults are done.
      
      Reviewed By: vitalybuka
      
      Differential Revision: https://reviews.llvm.org/D85947
      bb3a3da3
    • Stephen Neuendorffer's avatar
    • Stephen Neuendorffer's avatar
      [mlir] build fix for gcc-5 · 6ce8e4f4
      Stephen Neuendorffer authored
      It appears in this case that an implicit cast from StringRef to std::string
      doesn't happen.  Fixed with an explicit cast.
      
      Differential Revision: https://reviews.llvm.org/D85986
      6ce8e4f4
    • Marius Brehler's avatar
      [mlir] Make mlir_check_link_libraries() work with interface libraries · 324ae458
      Marius Brehler authored
      This changes mlir_check_link_libraries() to work with interface libraries.
      These don't have the LINK_LIBRARIES property.
      
      Differential Revision: https://reviews.llvm.org/D85957
      324ae458
    • Sameer Arora's avatar
      [llvm-libtool-darwin] Support universal outputs · 8f6f6f40
      Sameer Arora authored
      Add support for producing universal binaries containing archives when
      `llvm-libtool-darwin` is given inputs of multiple architectures.
      
      Reviewed by jhenderson, smeenai
      
      Differential Revision: https://reviews.llvm.org/D85334
      8f6f6f40
    • zacharyselk's avatar
      [clang-tools-extra] Added missing comma · caac40fa
      zacharyselk authored
      The new diagnostic tool (D85545) caught a missing comma, adding one to fix the warning.
      
      Differential Revision: https://reviews.llvm.org/D85978
      caac40fa
    • Haowei Wu's avatar
      Remove unnecessary HEADER_DIRS in lib/InterfaceStub/CMakeLists.txt · ee5d07e6
      Haowei Wu authored
      This change removes unnecessary HEADER_DIRS from //llvm/lib/
      InterfaceStub/CMakeLists.txt file.
      
      Differential Revision: https://reviews.llvm.org/D85936
      ee5d07e6
    • Matt Arsenault's avatar
      TableGen/GlobalISel: Partially handle immAllOnesV/immAllZerosV · 5c5e6d95
      Matt Arsenault authored
      These should really match either G_BUILD_VECTOR or
      G_BUILD_VECTOR_TRUNC, but there doesn't seem to be an existing
      mechanism for matching alternative opcodes. There is GIM_SwitchOpcode,
      but it seems to assume it's oly only used for matcher optimization.
      
      I could also omit any opcode check and rely on the matcher directly
      checking the opcode, but the table optimizer currently assumes there
      has to be an opcode check.
      
      Also doesn't try to handle undef elements like the DAG version.
      5c5e6d95
    • Simon Pilgrim's avatar
      [X86][SSE] Fold HOP(SHUFFLE(X),SHUFFLE(Y)) --> SHUFFLE(HOP(X,Y)) · e9eb2dc3
      Simon Pilgrim authored
      This is beginning to look like a canonicalization stage that could be performed as part of shuffle combining
      
      Another step towards PR41813
      
      Recommit of rG9bd97d03 with fixed offset adjustments
      e9eb2dc3
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Match andn2/orn2 for more types · 40a142fa
      Matt Arsenault authored
      Unfortunately this ends up not working as expected on targets with
      16-bit operations due to AMDGPUCodeGenPrepare's promotion of uniform
      16-bit ops to i32.
      
      The vector case annoyingly requires switching the checked opcode,
      since constants for vectors aren't directly handled.
      
      I also need to think more carefully about whether this is valid for i1.
      40a142fa
    • Jim Ingham's avatar
    • Mehdi Amini's avatar
      8f3f101b
    • Julian Lettner's avatar
      [TSan][libdispatch] Add interceptors for dispatch_async_and_wait() · d137db80
      Julian Lettner authored
      Add interceptors for `dispatch_async_and_wait[_f]()` which was added in
      macOS 10.14.  This pair of functions is similar to `dispatch_sync()`,
      but does not force a context switch of the queue onto the caller thread
      when the queue is active (and hence is more efficient).  For TSan, we
      can apply the same semantics as for `dispatch_sync()`.
      
      From the header docs:
      > Differences with dispatch_sync()
      >
      > When the runtime has brought up a thread to invoke the asynchronous
      > workitems already submitted to the specified queue, that servicing
      > thread will also be used to execute synchronous work submitted to the
      > queue with dispatch_async_and_wait().
      >
      > However, if the runtime has not brought up a thread to service the
      > specified queue (because it has no workitems enqueued, or only
      > synchronous workitems), then dispatch_async_and_wait() will invoke the
      > workitem on the calling thread, similar to the behaviour of functions
      > in the dispatch_sync family.
      
      Additional context:
      > The guidance is to use `dispatch_async_and_wait()` instead of
      > `dispatch_sync()` when it is necessary to mix async and sync calls on
      > the same queue. `dispatch_async_and_wait()` does not guarantee
      > execution on the caller thread which allows to reduce context switches
      > when the target queue is active.
      > https://gist.github.com/tclementdev/6af616354912b0347cdf6db159c37057
      
      rdar://35757961
      
      Reviewed By: kubamracek
      
      Differential Revision: https://reviews.llvm.org/D85854
      d137db80
    • Mehdi Amini's avatar
      Remove dependency from lib/CAPI/IR/IR.cpp on registerAllDialects() (build fix) · 059cb8b3
      Mehdi Amini authored
      This library does not depend on all the dialects, conceptually. This is
      changing the recently introduced `mlirContextLoadAllDialects()` function
      to not call `registerAllDialects()` itself, which aligns it better with
      the C++ code anyway (and this is deprecated and will be removed soon).
      059cb8b3
    • Stefan Gränitz's avatar
  2. Aug 14, 2020