1. May 18, 2021
    • Abbas Sabra's avatar
      [analyzer] Engine: fix crash with SEH __leave keyword · ebcf030e
      Abbas Sabra authored
      MSVC has a `try-except` statement.
      This statement could containt a `__leave` keyword, which is similar to
      `goto` to the end of the try block. The semantic of this keyword is not
      implemented.
      
      We should at least parse such code without crashing.
      
      https://docs.microsoft.com/en-us/cpp/cpp/try-except-statement?view=msvc-160
      
      Patch By: AbbasSabra!
      
      Reviewed By: steakhal
      
      Differential Revision: https://reviews.llvm.org/D102280
      ebcf030e
    • Michael Benfield's avatar
      [Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable · 14dfb383
      Michael Benfield authored
      These are intended to mimic warnings available in gcc.
      
      Reviewed By: aeubanks
      
      Differential Revision: https://reviews.llvm.org/D100581
      14dfb383
    • Nico Weber's avatar
      Revert "[NewPM] Add C bindings for new pass manager" · 0b339778
      Nico Weber authored
      This reverts commit cd220a06.
      Doesn't build.
      0b339778
    • Jim Ingham's avatar
      bd5751f3
    • Mats Larsen's avatar
      [NewPM] Add C bindings for new pass manager · cd220a06
      Mats Larsen authored
      This patch contains the bare minimum to run the new Pass Manager from the LLVM-C APIs. It does not feature PGOOptions, PassPlugins or Debugify in its current state. Bugzilla: PR48499
      
      Reviewed By: aeubanks
      
      Differential Revision: https://reviews.llvm.org/D102136
      cd220a06
    • Shafik Yaghmour's avatar
      [LLDB] Switch from using member_clang_type.GetByteSize() to... · 2182eda3
      Shafik Yaghmour authored
      [LLDB] Switch from using member_clang_type.GetByteSize() to member_type->GetByteSize() in ParseSingleMember
      
      We have a bug in which using member_clang_type.GetByteSize() triggers record
      layout and during this process since the record was not yet complete we ended
      up reaching a record that had not been layed out yet.
      Using member_type->GetByteSize() avoids this situation since it relies on size
      from DWARF and will not trigger record layout.
      
      For reference: rdar://77293040
      
      Differential Revision: https://reviews.llvm.org/D102445
      2182eda3
    • Roman Lebedev's avatar
      [LoopIdiom] 'logical right-shift until zero' ('count active bits') "on steroids" idiom recognition. · 0633d5ce
      Roman Lebedev authored
      I think i've added exhaustive test coverage, and i have verified that alive2 is happy with all the tests,
      so in principle i'm fine with landing this without review, but just in case..
      
      This adds support for the "count active bits" pattern, i.e.:
      ```
      int countActiveBits(unsigned val) {
          int cnt = 0;
          for( ; (val >> cnt) != 0; ++cnt)
              ;
          return cnt;
      }
      ```
      but a somewhat more general one, since that is what i need:
      ```
      int countActiveBits(unsigned val, int start, int off) {
          int cnt;
          for (cnt = start; val >> (cnt + off); cnt++)
              ;
          return cnt;
      }
      ```
      
      I've followed in footstep of 'left-shift until bittest' idiom (D91038),
      in the sense that iff the `ctlz` intrinsic is cheap, we'll transform,
      regardless of all other factors.
      
      This can have a shocking effect on certain benchmarks:
      ```
      raw.pixls.us-unique/Olympus/XZ-1$ /repositories/googlebenchmark/tools/compare.py -a benchmarks ~/rawspeed/build-{old,new}/src/utilities/rsbench/rsbench --benchmark_counters_tabular=true --benchmark_min_time=0.00000001 --benchmark_repetitions=128 p1319978.orf
      RUNNING: /home/lebedevri/rawspeed/build-old/src/utilities/rsbench/rsbench --benchmark_counters_tabular=true --benchmark_min_time=0.00000001 --benchmark_repetitions=128 p1319978.orf --benchmark_display_aggregates_only=true --benchmark_out=/tmp/tmp49_28zcm
      2021-05-09T01:06:05+03:00
      Running /home/lebedevri/rawspeed/build-old/src/utilities/rsbench/rsbench
      Run on (32 X 3600.24 MHz CPU s)
      CPU Caches:
        L1 Data 32 KiB (x16)
        L1 Instruction 32 KiB (x16)
        L2 Unified 512 KiB (x16)
        L3 Unified 32768 KiB (x2)
      Load Average: 5.26, 6.29, 3.49
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      Benchmark                                                      Time             CPU   Iterations  CPUTime,s CPUTime/WallTime     Pixels Pixels/CPUTime Pixels/WallTime Raws/CPUTime Raws/WallTime WallTime,s
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      p1319978.orf/threads:32/process_time/real_time_mean          145 ms          145 ms          128   0.145319         0.999981   10.1568M       69.8949M        69.8936M      6.88159       6.88146   0.145322
      p1319978.orf/threads:32/process_time/real_time_median        145 ms          145 ms          128   0.145317         0.999986   10.1568M       69.8941M        69.8931M      6.88151       6.88141   0.145319
      p1319978.orf/threads:32/process_time/real_time_stddev      0.766 ms        0.766 ms          128   766.586u         15.1302u          0       354.167k        354.098k    0.0348699     0.0348631   766.469u
      RUNNING: /home/lebedevri/rawspeed/build-new/src/utilities/rsbench/rsbench --benchmark_counters_tabular=true --benchmark_min_time=0.00000001 --benchmark_repetitions=128 p1319978.orf --benchmark_display_aggregates_only=true --benchmark_out=/tmp/tmpwb9sw2x0
      2021-05-09T01:06:24+03:00
      Running /home/lebedevri/rawspeed/build-new/src/utilities/rsbench/rsbench
      Run on (32 X 3599.95 MHz CPU s)
      CPU Caches:
        L1 Data 32 KiB (x16)
        L1 Instruction 32 KiB (x16)
        L2 Unified 512 KiB (x16)
        L3 Unified 32768 KiB (x2)
      Load Average: 4.05, 5.95, 3.43
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      Benchmark                                                      Time             CPU   Iterations  CPUTime,s CPUTime/WallTime     Pixels Pixels/CPUTime Pixels/WallTime Raws/CPUTime Raws/WallTime WallTime,s
      ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      p1319978.orf/threads:32/process_time/real_time_mean         99.8 ms         99.8 ms          128  0.0997758         0.999972   10.1568M       101.797M        101.794M      10.0225       10.0222  0.0997786
      p1319978.orf/threads:32/process_time/real_time_median       99.7 ms         99.7 ms          128  0.0997165         0.999985   10.1568M       101.857M        101.854M      10.0284       10.0281  0.0997195
      p1319978.orf/threads:32/process_time/real_time_stddev      0.224 ms        0.224 ms          128   224.166u          34.345u          0        226.81k        227.231k    0.0223309     0.0223723   224.586u
      Comparing /home/lebedevri/rawspeed/build-old/src/utilities/rsbench/rsbench to /home/lebedevri/rawspeed/build-new/src/utilities/rsbench/rsbench
      Benchmark                                                               Time             CPU      Time Old      Time New       CPU Old       CPU New
      ----------------------------------------------------------------------------------------------------------------------------------------------------
      p1319978.orf/threads:32/process_time/real_time_pvalue                 0.0000          0.0000      U Test, Repetitions: 128 vs 128
      p1319978.orf/threads:32/process_time/real_time_mean                  -0.3134         -0.3134           145           100           145           100
      p1319978.orf/threads:32/process_time/real_time_median                -0.3138         -0.3138           145           100           145           100
      p1319978.orf/threads:32/process_time/real_time_stddev                -0.7073         -0.7078             1             0             1             0
      
      ```
      
      Reviewed By: craig.topper, zhuhan0
      
      Differential Revision: https://reviews.llvm.org/D102116
      0633d5ce
    • Matt Morehouse's avatar
      [HWASan] Don't build alias mode on non-x86. · d97bab65
      Matt Morehouse authored
      Alias mode is not expected work on non-x86, so don't build it there.
      Should fix the aarch64 bot.
      d97bab65
    • Mehdi Amini's avatar
      Make `mlir::OpState::operator bool` explicit · 43f6e042
      Mehdi Amini authored
      This change makes the conversion of an mlir::OpState to bool `explicit`. Idiomatic boolean uses continue to work as before, but questionable implicit uses (e.g. accumulating over a range of OpStates to count "true" states) become ill-formed. This makes the class interface a lilttle less error-prone.
      
      I tested this change on our internal (fairly large) codebase, and only one fix was needed, which was ultimately an improvement of the affected code.
      
      Reviewed By: rriddle, mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D101989
      43f6e042
    • Yaxun (Sam) Liu's avatar
      [HIP] Fix spack detection · 18cb17ce
      Yaxun (Sam) Liu authored
      Missing or duplicate spack package should not cause error, since
      users may only installed llvm/clang package, or users may installed
      duplicate HIP package but will use environment variable or compiler
      option to choose HIP path.
      
      The message about missing or duplicate spack package is informational,
      therefore should be emitted only when -v is specified.
      
      Reviewed by: Artem Belevich
      
      Differential Revision: https://reviews.llvm.org/D102556
      18cb17ce
    • Rob Suderman's avatar
      [mlir][tosa] Fix tosa.avg_pool2d lowering to normalize correctly · 08068ddb
      Rob Suderman authored
      Initial version of pooling assumed normalization was accross all elements
      equally. TOSA actually requires the noramalization is perform by how
      many elements were summed (edges are not artifically dimmer). Updated
      the lowering to reflect this change with corresponding tests.
      
      Reviewed By: NatashaKnk
      
      Differential Revision: https://reviews.llvm.org/D102540
      08068ddb
    • Steffen Larsen's avatar
      [Clang][NVPTX] Add NVPTX intrinsics and builtins for CUDA PTX redux.sync instructions · f226e28a
      Steffen Larsen authored
      Adds NVPTX builtins and intrinsics for the CUDA PTX `redux.sync` instructions
      for `sm_80` architecture or newer.
      
      PTX ISA description of `redux.sync`:
      https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#parallel-synchronization-and-communication-instructions-redux-sync
      
      
      
      Authored-by: default avatarSteffen Larsen <steffen.larsen@codeplay.com>
      
      Differential Revision: https://reviews.llvm.org/D100124
      f226e28a
    • Stuart Adams's avatar
    • Alex Zinenko's avatar
      [llvm][doc] fix header for read/write_register intrinsics in LangRef · 1417ddaf
      Alex Zinenko authored
      Mutli-line headers are not allowed in RST, reformat the header to be a
      single wide line.
      1417ddaf
    • Matt Morehouse's avatar
      [HWASan] Build separate LAM runtime on x86_64. · 5f583223
      Matt Morehouse authored
      Since we have both aliasing mode and Intel LAM on x86_64, we need to
      choose the mode at either run time or compile time.  This patch
      implements the plumbing to build both and choose between them at
      compile time.
      
      Reviewed By: vitalybuka, eugenis
      
      Differential Revision: https://reviews.llvm.org/D102286
      5f583223
    • Shilei Tian's avatar
      [OpenMP] Fixed Bug 49356 · af6511d7
      Shilei Tian authored
      Bug 49356 (https://bugs.llvm.org/show_bug.cgi?id=49356) reports crash in
      the test case `tasking/bug_taskwait_detach.cpp`, which is caused by the wrong
      function declaration. `gtid` in `__kmpc_omp_task` should be `kmp_int32`.
      
      Reviewed By: AndreyChurbanov
      
      Differential Revision: https://reviews.llvm.org/D102584
      af6511d7
    • Florian Hahn's avatar
      [LoopUnroll] Add multi-exit test which does not exit through latch. · fded6f77
      Florian Hahn authored
      This patch adds a new test for loop-unrolling with multiple exiting
      blocks, where the latch does not exit, but the header does. This can
      happen when the loop has not been rotated, e.g. due to minsize.
      
      Inspired by the following end-to-end test, using -Oz
      https://godbolt.org/z/fP6sna8qK
      
          bool foo(int *ptr, int limit) {
              #pragma clang loop unroll(full)
              for (unsigned int i = 0; i < 4; i++) {
                  if (ptr[i] > limit)
                  return false;
                  ptr[i]++;
              }
              return true;
          }
      fded6f77
  2. May 17, 2021