1. May 18, 2021
    • Philip Reames's avatar
      Revert "[LV] Unconditionally branch from middle to scalar preheader if the... · d16da734
      Philip Reames authored
      Revert "[LV] Unconditionally branch from middle to scalar preheader if the scalar loop must execute"
      
      This reverts commit c23ce54b.  I apparently missed some newly added non-x86 tests.
      d16da734
    • Philip Reames's avatar
      [LV] Unconditionally branch from middle to scalar preheader if the scalar loop must execute · c23ce54b
      Philip Reames authored
      This is a resubmit of 3e5ce4 (which was reverted by 7fe41ac3).  The original commit caused a PPC build bot failure we never really got to the bottom of.  I can't reproduce the issue, and the bot owner was non-responsive.  In the meantime, we stumbled across an issue which seems possibly related, and worked around a latent bug in 80e80250.  My best guess is that the original patch exposed that latent issue at higher frequency, but it really is just a guess.
      
      Original commit message follows...
      
      If we know that the scalar epilogue is required to run, modify the CFG to end the middle block with an unconditional branch to scalar preheader. This is instead of a conditional branch to either the preheader or the exit block.
      
      The motivation to do this is to support multiple exit blocks. Specifically, the current structure forces us to identify immediate dominators and *which* exit block to branch from in the middle terminator. For the multiple exit case - where we know require scalar will hold - these questions are ill formed.
      
      This is the last change needed to support multiple exit loops, but since the diffs are already large enough, I'm going to land this, and then enable separately. You can think of this as being NFCIish prep work, but the changes are a bit too involved for me to feel comfortable tagging the review that way.
      
      Differential Revision: https://reviews.llvm.org/D94892
      c23ce54b
    • Ben Shi's avatar
      [RISCV][test] Add new tests of or/xor in the zbs extension · 3cf7983c
      Ben Shi authored
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D102625
      3cf7983c
    • Ben Shi's avatar
      [clang][AVR] Redefine [u]int16_t to be compatible with avr-gcc · b99e2c56
      Ben Shi authored
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D102547
      b99e2c56
    • Jim Ingham's avatar
      Revert "Reset the wakeup timeout when we re-enter the continue wait." · 82a38837
      Jim Ingham authored
      This reverts commit bd5751f3.
      This patch series is causing us to every so often miss switching
      the state from eStateRunning to eStateStopped when we get the stop
      packet from the debug server.
      
      Reverting till I can figure out how that could be happening.
      82a38837
    • Scott Linder's avatar
      [ADT] Add new type traits for type pack indexes · a6d3987b
      Scott Linder authored
      Similar versions of these already exist, this effectively just just
      factors them out into STLExtras. I plan to use these in future patches.
      
      Differential Revision: https://reviews.llvm.org/D100672
      a6d3987b
    • Scott Linder's avatar
      af5247c9
    • Eli Friedman's avatar
      [AArch64][SVE] Implement extractelement of i1 vectors. · 3dd49ec1
      Eli Friedman authored
      The implementation just extends the vector to a larger element type, and
      extracts from that.  Not fancy, but generates reasonable code.
      
      There was discussion in the review of doing the promotion in
      target-independent code, but I'm sticking with this to avoid making
      LegalizeDAG infrastructure more complicated.
      
      Differential Revision: https://reviews.llvm.org/D87651
      3dd49ec1
    • Philip Reames's avatar
      Do actual DCE in LoopUnroll (try 3) · b6320eeb
      Philip Reames authored
      Recommitting after fixing a bug found post commit.  Amusingly, try 1 had been correct, and by reverting to incorporate last minute review feedback, I introduce the bug.  Oops.  :)
      
      The problem was that recursively deleting an instruction can delete instructions beyond the current iterator (via a dead phi), thus invalidating iteration.  Test case added in LoopUnroll/dce.ll to cover this case.
      
      LoopUnroll does a limited DCE pass after unrolling, but if you have a chain of dead instructions, it only deletes the last one. Improve the code to recursively delete all trivially dead instructions.
      
      Differential Revision: https://reviews.llvm.org/D102511
      b6320eeb
    • Arthur Eubanks's avatar
      ceb1ac98
    • Heejin Ahn's avatar
      [WebAssembly] Nullify DBG_VALUE_LISTs in DebugValueManager · 6e1c1dac
      Heejin Ahn authored
      WebAssemblyDebugValueManager class currently does not handle
      DBG_VALUE_LIST instructions correctly for two reasons, which are
      explained in https://bugs.llvm.org/show_bug.cgi?id=50361.
      
      This effectively nullifies DBG_VALUE_LISTs in
      WebAssemblyDebugValueManager so that the info will appear as "optimized
      out" in debuggers but still be at least correct in the meantime.
      
      Reviewed By: dschuff, jmorse
      
      Differential Revision: https://reviews.llvm.org/D102589
      6e1c1dac
    • River Riddle's avatar
      [mlir][NFC] Remove stale `createLowerAffinePass` declaration · e2e1a78a
      River Riddle authored
      This pass isn't defined in the Transforms/ library anymore.
      e2e1a78a
    • Jinsong Ji's avatar
      [Driver][test] Don't assume integrated-as · 82b52812
      Jinsong Ji authored
      The tests of fdebug-compilation-dir and -ffile-compilation-dir for `-x
      assembler` are assuming integrated-as.
      If the platform set the no-itegrated-as by default (eg: AIX for now), then this test will
      fail.
      
      Add the -integrated-as to aviod relying on the platform defaults.
      
      Reviewed By: thakis
      
      Differential Revision: https://reviews.llvm.org/D102647
      82b52812
    • Eli Friedman's avatar
      [clang CodeGen] Don't crash on large atomic function parameter. · 698568b7
      Eli Friedman authored
      I wouldn't recommend writing code like the testcase; a function
      parameter isn't atomic, so using an atomic type doesn't really make
      sense.  But it's valid, so clang shouldn't crash on it.
      
      The code was assuming hasAggregateEvaluationKind(Ty) implies Ty is a
      RecordType, which isn't true.  Just use isRecordType() instead.
      
      Differential Revision: https://reviews.llvm.org/D102015
      698568b7
    • Markus Böck's avatar
      [lld][MinGW] Introduce aliases for -Bdynamic and -Bstatic · 65271ffe
      Markus Böck authored
      Besides -Bdynamic and -Bstatic, ld documents additional aliases for both of these options. Instead of -Bstatic, one may write -dn, -non_shared or -static. Instead of -Bdynamic one may write -dy or -call_shared. Source: https://sourceware.org/binutils/docs-2.36/ld/Options.html
      
      This patch adds those aliases to the MinGW driver of lld for the sake of ld compatibility.
      
      Encountered this case while compiling a static Qt 6.1 distribution and got build failures as -static was passed directly to the linker, instead of through the compiler driver.
      
      Differential Revision: https://reviews.llvm.org/D102637
      65271ffe
    • Dave Lee's avatar
      [lldb] Document ctrl-f for completing show-autosuggestion · 02286d96
      Dave Lee authored
      Document how to complete command line suggestions provided by `show-autosuggestion`.
      
      Differential Revision: https://reviews.llvm.org/D102544
      02286d96
    • Mitch Phillips's avatar
      Revert "X86: support Swift Async context" · 6791a6b3
      Mitch Phillips authored
      This reverts commit 747e5cfb.
      
      Reason: New frame layout broke the sanitizer unwinder. Not clear why,
      but seems like some of the changes aren't always guarded by Swyft
      checks. See
      https://reviews.llvm.org/rG747e5cfb9f5d944b47fe014925b0d5dc2fda74d7 for
      more information.
      6791a6b3
    • Vitaly Buka's avatar
      [NFC][scudo] Clang-format tests · 1eb78a64
      Vitaly Buka authored
      1eb78a64
    • Arthur Eubanks's avatar
      Revert "[Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable" · 3a0b6dc3
      Arthur Eubanks authored
      This reverts commit 14dfb383.
      
      More false positives, see D100581.
      3a0b6dc3
    • LLVM GN Syncbot's avatar
      [gn build] Port 0c557db6 · 11c857c7
      LLVM GN Syncbot authored
      11c857c7
    • Sanjay Patel's avatar
      [InstCombine] fold fnegs around select · 3cdd05e5
      Sanjay Patel authored
      This is one of the folds requested in:
      https://llvm.org/PR39480
      
      https://alive2.llvm.org/ce/z/NczU3V
      
      Note - this uses the normal FMF propagation logic
      (flags transfer from the final value to new/intermediate ops).
      It's not clear if this matches what Alive2 implements,
      so we may want to adjust one or the other.
      3cdd05e5
    • Sanjay Patel's avatar
      e9f600f2
    • Nick Desaulniers's avatar
      [AArch64] Support customizing stack protector guard · 0f417789
      Nick Desaulniers authored
      Follow up to D88631 but for aarch64; the Linux kernel uses the command
      line flags:
      
      1. -mstack-protector-guard=sysreg
      2. -mstack-protector-guard-reg=sp_el0
      3. -mstack-protector-guard-offset=0
      
      to use the system register sp_el0 for the stack canary, enabling the
      kernel to have a unique stack canary per task (like a thread, but not
      limited to userspace as the kernel can preempt itself).
      
      Address pr/47341 for aarch64.
      
      Fixes: https://github.com/ClangBuiltLinux/linux/issues/289
      
      
      Signed-off-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      
      Reviewed By: xiangzhangllvm, DavidSpickett, dmgreen
      
      Differential Revision: https://reviews.llvm.org/D100919
      0f417789
    • Peter Collingbourne's avatar
      gn build: Only build the hwasan runtime in aliasing mode on x86. · c870e36b
      Peter Collingbourne authored
      The LAM mode is currently untested by check-hwasan, so we only need
      to build the runtime in aliasing mode. Because LAM mode will always
      need to be conditional (because only certain hardware will support
      it) we can always just disable the LAM lit tests if it ever starts
      being tested.
      c870e36b
    • Jacques Pienaar's avatar
      Add type function for ConstShape op. · 24bf554b
      Jacques Pienaar authored
      - Enables inferring return type for ConstShape, takes into account valid return types;
      - The compatible return type function could be reused, leaving that for next use refactoring;
      
      Differential Revision: https://reviews.llvm.org/D102182
      24bf554b
    • Mats Larsen's avatar
      [NewPM] Add C bindings for new pass manager · 0c557db6
      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
      0c557db6
    • Aart Bik's avatar
      [mlir][sparse] replace experimental flag with inplace attribute · 5879da49
      Aart Bik authored
      The experimental flag for "inplace" bufferization in the sparse
      compiler can be replaced with the new inplace attribute. This gives
      a uniform way of expressing the more efficient way of bufferization.
      
      Reviewed By: bixia
      
      Differential Revision: https://reviews.llvm.org/D102538
      5879da49
    • Nico Weber's avatar
      [lld/mac] Honor REFERENCED_DYAMICALLY, set it on __mh_execute_header · 4a12248e
      Nico Weber authored
      Has the effect that `__mh_execute_header` stays in the symbol table of
      outputs even after running `strip` on the output. I don't know if that's
      important for anything -- my motivation for the patch is just is to make
      the output more similar to ld64.
      
      (Corresponds to symbolTableInAndNeverStrip in ld64.)
      
      Differential Revision: https://reviews.llvm.org/D102619
      4a12248e
    • Chris Lattner's avatar
      Merge with mainline. · 648f34a2
      Chris Lattner authored
      Differential Revision: https://reviews.llvm.org/D102636
      648f34a2
    • 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