1. Jan 21, 2022
    • Simon Pilgrim's avatar
      [X86] combineVectorHADDSUB - remove the broken HOP(x,x) merging code (PR51974) · 75e33f71
      Simon Pilgrim authored
      This intention of this code turns out to be superfluous as we can handle this with shuffle combining, and it has a critical flaw in that it doesn't check for dependencies.
      
      Fixes PR51974
      
      (cherry picked from commit 468ff703)
      75e33f71
    • Fangrui Song's avatar
      [CMake] Don't use -fno-semantic-interposition with Clang<=13 · 6349865a
      Fangrui Song authored
      Clang 13 has a -fsanitize-coverage -fno-semantic-interposition bug (D117190)
      which may lead to
      `relocation R_X86_64_PC32 cannot be used against symbol` linker error
      in -DLLVM_USE_SANITIZE_COVERAGE=ON build when a shared object is built (e.g.
      -DLLVM_BUILD_LLVM_DYLIB=on).
      
      For simplicity, just disallow Clang 13 entirely.
      
      Note: GCC -fPIC performance benefits from -fno-semantic-interposition
      dramatically. Clang benefits little. Using this option is more for a dogfood
      purpose to test correctness of this option, because in the wild some important
      packages like CPython uses this option.
      
      Differential Revision: https://reviews.llvm.org/D117183
      
      (cherry picked from commit 1661c8cf)
      6349865a
    • David Green's avatar
      [ARM] Define ComplexPatternFuncMutatesDAG · b3dcd156
      David Green authored
      Some of the Arm complex pattern functions call canExtractShiftFromMul,
      which can modify the DAG in-place. For this to be valid and handled
      successfully we need to define ComplexPatternFuncMutatesDAG.
      
      Differential Revision: https://reviews.llvm.org/D107476
      
      (cherry picked from commit 77e8f4ee)
      b3dcd156
  2. Jan 19, 2022
  3. Jan 15, 2022
  4. Jan 13, 2022
    • Chuanqi Xu's avatar
      [Coroutines] Enhance symmetric transfer for constant CmpInst · b9a243d1
      Chuanqi Xu authored
      This fixes bug52896.
      
      Simply, some symmetric transfer optimization chances get invalided due
      to we delete some inlined optimization passes in 822b92aa. This would
      cause stack-overflow in some situations which should be avoided by the
      design of coroutine. This patch tries to fix this by transforming the
      constant CmpInst instruction which was done in the deleted passes.
      
      Reviewed By: rjmccall, junparser
      
      Differential Revision: https://reviews.llvm.org/D116327
      
      (cherry picked from commit 403772ff)
      b9a243d1
  5. Jan 12, 2022
    • Fangrui Song's avatar
      [lld][CMake] Add LLD_DEFAULT_NOSTART_STOP_GC · 9d9efb1f
      Fangrui Song authored
      This option is for groups who need time to accomodate the ld.lld -z
      start-stop-gc default.
      
      This is a modified version of https://reviews.llvm.org/D114186 that
      enables this option by default.
      9d9efb1f
    • Nick Desaulniers's avatar
      [InlineCost] model calls to llvm.is.constant* more carefully · 52a400d8
      Nick Desaulniers authored
      llvm.is.constant* intrinsics are evaluated to 0 or 1 integral values.
      
      A common use case for llvm.is.constant comes from the higher level
      __builtin_constant_p. A common usage pattern of __builtin_constant_p in
      the Linux kernel is:
      
          void foo (int bar) {
            if (__builtin_constant_p(bar)) {
              // lots of code that will fold away to a constant.
            } else {
              // a little bit of code, usually a libcall.
            }
          }
      
      A minor issue in InlineCost calculations is when `bar` is _not_ Constant
      and still will not be after inlining, we don't discount the true branch
      and the inline cost of `foo` ends up being the cost of both branches
      together, rather than just the false branch.
      
      This leads to code like the above where inlining will not help prove bar
      Constant, but it still would be beneficial to inline foo, because the
      "true" branch is irrelevant from a cost perspective.
      
      For example, IPSCCP can sink a passed constant argument to foo:
      
          const int x = 42;
          void bar (void) { foo(x); }
      
      This improves our inlining decisions, and fixes a few head scratching
      cases were the disassembly shows a relatively small `foo` not inlined
      into a lone caller.
      
      We could further improve this modeling by tracking whether the argument
      to llvm.is.constant* is a parameter of the function, and if inlining
      would allow that parameter to become Constant. This idea is noted in a
      FIXME comment.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1302
      
      Reviewed By: kazu
      
      Differential Revision: https://reviews.llvm.org/D111272
      
      (cherry picked from commit 9697f935)
      52a400d8
    • Tim Northover's avatar
      ARM: make FastISel & GISel pass -1 to ADJCALLSTACKUP to signal no callee pop. · eaeb7dcf
      Tim Northover authored
      The interface for these instructions changed with support for mandatory tail
      calls, and now -1 indicates the CalleePopAmount argument is not valid.
      Unfortunately I didn't realise FastISel or GISel did calls at the time so
      didn't update them.
      
      (cherry picked from commit 0b5b35fd)
      eaeb7dcf
    • serge-sans-paille's avatar
      Have lit preserve SOURCE_DATE_EPOCH · eecd0f05
      serge-sans-paille authored
      This environment variable has been standardized for reproducible builds. Setting
      it can help to have reproducible tests too, so keep it as part of the testing
      env when set.
      
      See https://reproducible-builds.org/docs/source-date-epoch/
      
      Differential Revision: https://reviews.llvm.org/D108332
      
      (cherry picked from commit 46c947af)
      eecd0f05
  6. Jan 08, 2022
  7. Jan 07, 2022
  8. Jan 06, 2022
  9. Jan 05, 2022
  10. Dec 23, 2021
  11. Dec 22, 2021
  12. Dec 21, 2021
  13. Dec 18, 2021
  14. Dec 17, 2021
    • Nemanja Ivanovic's avatar
      [PowerPC] Handle base load with reservation mnemonic · 9fb79e69
      Nemanja Ivanovic authored
      The Power ISA defined l[bhwdq]arx as both base and
      extended mnemonics. The base mnemonic takes the EH
      bit as an operand and the extended mnemonic omits
      it, making it implicitly zero. The existing
      implementation only handles the base mnemonic when
      EH is 1 and internally produces a different
      instruction. There are historical reasons for this.
      This patch simply removes the limitation introduced
      by this implementation that disallows the base
      mnemonic with EH = 0 in the ASM parser.
      
      This resolves an issue that prevented some files
      in the Linux kernel from being built with
      -fintegrated-as.
      
      Also fix a crash if the value is not an integer immediate.
      
      (cherry picked from commit d6c0ef78)
      9fb79e69
    • George Koehler's avatar
      [ELF][PPC32] Make R_PPC32_PLTREL retain .got · e68f640d
      George Koehler authored
      PLT usage needs the first 12 bytes of the .got section. We need to keep .got and
      DT_GOT_PPC even if .got/_GLOBAL_OFFSET_TABLE_ are not referenced (large PIC code
      may only reference .got2), which is the case in OpenBSD's ld.so, leading
      to a misleading error, "unsupported insecure BSS PLT object".
      
      Fix this by adding R_PPC32_PLTREL to the list of hasGotOffRel.
      
      Reviewed By: MaskRay
      
      Differential Revision: https://reviews.llvm.org/D114982
      
      (cherry picked from commit 885fb9a2)
      e68f640d