Changes

Summary

  1. [WebAssembly] Optimize out shift masks (details)
  2. [WebAssembly][lld] Fix segfault on .bss sections in mapfile (details)
  3. [ORC] Improve computeLocalDeps / computeNamedSymbolDependencies performance. (details)
  4. [ORC] Introduce ExecutorAddress type, fix broken LLDB bot. (details)
  5. [mlir][linalg] Tighter StructuredOp Verification. (details)
  6. [lld/mac] Fix warning about unused variable [NFC] (details)
  7. [AMDGPU] Fix typo (details)
  8. [mlir] factor out ConvertToLLVMPattern (details)
  9. [mlir][MemRef] Fix DimOp folding of OffsetSizeAndStrideInterface. (details)
  10. [mlir][linalg] Remove GenericOpBase. (details)
  11. [mlir][linalg][python] Add exp and log to the OpDSL. (details)
  12. [libcxx] [test] Fix spurious failures in the thread detach test on Windows (details)
  13. [IR] Added operator delete to subclasses of User to avoid UB (details)
  14. Revert "[mlir][MemRef] Fix DimOp folding of OffsetSizeAndStrideInterface." (details)
  15. [Test] Add loop deletion switch tests (details)
  16. [AArch64][SVE] Add ISel patterns for floating point compare with zero instructions (details)
  17. [mlir-reduce] Fix the memory leak and recycle unused modules. (details)
  18. [NFC] Mark Expected<T>::assertIsChecked() as const (details)
  19. Support: add llvm::thread class that supports specifying stack size. (details)
  20. Revert "Support: add llvm::thread class that supports specifying stack size." (details)
  21. [amdgpu] Remove the GlobalDCE pass prior to the internalization pass. (details)
  22. [Instcombine][NFC]Add a test for reduce+([sext/zext](<n x i1)) case, NFC. (details)
  23. [mlir] Fully qualify types and expressions in Interfaces (details)
  24. [Internalize] Preserve variables externally initialized. (details)
  25. [Instcombine]Transform reduction+(sext/zext(<n x i1>) to <n x im>) to [-]zext/trunc(ctpop(bitcast <n x i1> to in)) to im. (details)
  26. Recommit: Support: add llvm::thread class that supports specifying stack size. (details)
  27. [libc++] Guard testing implementation details. (details)
  28. [libc++][NFC] Move monostate to its own header. (details)
  29. [gn build] Port 321c2ea91cb1 (details)
  30. [DebugInfo][InstrRef][4/4] Support DBG_INSTR_REF through all backend passes (details)
  31. [libc++] Workaround failures with modules on Clang ToT (details)
  32. [libc++][docs] Update documentation to reflect libc++'s compiler support policy (details)
  33. [IR] Restore vector support for deprecated CreateGEP methods (details)
  34. [libc++][ci] Stop testing on GCC previous, since we don't support it anymore (details)
  35. [AMDGPU] Set LoopInfo as preserved by SIAnnotateControlFlow (details)
  36. [mlir][sparse] updated setter/getter comments (details)
  37. [LangRef] Clarify !associated (details)
  38. [CostModel][X86] Account for older SSE targets with slow fp->int conversions (details)
  39. Fix MSVC "truncation from 'int' to 'bool'" warning. NFCI. (details)
  40. [ScalarEvolution] Fix overflow in computeBECount. (details)
  41. [compiler-rt][hwasan] Define fuchsia implementations of required hwasan functions (details)
  42. [LangRef] Fix typo about SHF_LINK_ORDER (details)
  43. Mips/GlobalISel: Use correct callee calling convention (details)
  44. GlobalISel: Track original argument index in ArgInfo (details)
  45. Mips/GlobalISel: Remove custom splitToValueTypes (details)
  46. [AMDGPU] Fix indention in llc-pipeline test. NFC. (details)
  47. [Metadata] Decorate methods with 'const'. NFC. (details)
  48. [mlir][Linalg] Fix tensor.extract_slice(linalg.init_tensor) canonicalization for rank-reducing extract (details)
  49. [libc++][ci] Install Clang 11, Clang 12 and Clang ToT in the Docker image (details)
  50. [AMDGPU] Fix more indention in llc-pipeline test. NFC. (details)
  51. [clang] fix constexpr code generation for user conversions. (details)
  52. [X86][NFC]Add run lines for AVX512VL for masked gather test, NFC. (details)
  53. [CodeGen] Avoid CreateGEP with nullptr type (NFC) (details)
  54. [libc++] Add XFAIL for Clang ToT with modules (details)
  55. [ARM] Use matchSimpleRecurrence to simplify some code in MVEGatherScatterLowering. NFCI (details)
  56. [SLP][COST][X86]Improve cost model for masked gather. (details)
  57. [OPENMP]Do no privatize const firstprivates in target regions. (details)
  58. [NVPTX] Pass explicit GEP type (NFC) (details)
  59. [AMDGPU] Pass explicit GEP type in printf transform (NFC) (details)
  60. [AMDGPU] Simplify GEP construction (NFC) (details)
  61. [CodeGen] Avoid nullptr arg to CreateStructGEP (NFC) (details)
  62. [SLP]Improve vectorization of stores. (details)
  63. [msan] Add funel shift tests (details)
  64. [msan] Handle funnel shifts (details)
  65. [GWP-ASan] Change unreachable -> trap to work around DCE bug. (details)
  66. [NFC][compiler-rt][fuchsia] Add InitShadowBounds declaration to header (details)
  67. PR51018: Remove explicit conversions from SmallString to StringRef to future-proof against C++23 (details)
  68. PR51018: Disallow explicit construction of StringRef from SmallString due to ambiguity in C++23 (details)
  69. Revert "PR51018: Disallow explicit construction of StringRef from SmallString due to ambiguity in C++23" (details)
  70. [mlir][bazel] Added missing MathDialect dep to LinalgOps target (details)
  71. [InstCombine][NFC]Use only `replaceInstUsesWith`, NFC. (details)
  72. [ARM] Extra v8i16 -> i64 reduction tests with loads. NFC (details)
  73. [WebAssembly] Scalarize extract_vector_elt of binops (details)
  74. Mark TensorDialect legal and PadTensor op illegal (details)
  75. [ARM] Pass 2 instead of 0 to PHINode::Create in MVEGatherScatterLowering. NFC (details)
  76. [AMDGPU] Mark more SOP instructions as rematerializable (details)
  77. [mlir][sparse] Add Merger unit tests (details)
  78. Add AddDiscriminatorsPass to NPM default O0 pipeline (details)
  79. Add documentation for -fsanitize-address-use-after-return. (details)
  80. [mlir-reduce] Fix the grammer in the doc (details)
  81. [NFC][ScalarEvolution] Cleanup howManyLessThans. (details)
  82. Revert "[mlir][sparse] Add Merger unit tests" (details)
  83. [RISCV][test] Add new tests for mul optimization in the zba extension with SH*ADD (details)
  84. [ASan][AMDGPU] Make shadow offset match X86 on Linux (details)
  85. Revert "GlobalISel/AArch64: don't optimize away redundant branches at -O0" (details)
  86. Update Bazel overlay in GPUToGPURuntimeTransforms. (details)
  87. [PowerPC] Remove implicit use register after transformToImmFormFedByLI() (details)
  88. [CMake] Disable -fno-semantic-interposition for GCC<10.3 on SystemZ (details)
  89. [RISCV][clang] Add macro __riscv_zvlsseg for RVV Zvlsseg builtins (details)
Commit f8c5a4c67075877e1b6976bb7372aa96f02c11bc by tlively
[WebAssembly] Optimize out shift masks

WebAssembly's shift instructions implicitly masks the shift count, so optimize
out redundant explicit masks of the shift count. For vector shifts, this
currently only works if the mask is applied before splatting the shift count,
but this should be addressed in a future commit. Resolves PR49655.

Differential Revision: https://reviews.llvm.org/D105600
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyInstrInteger.td
The file was addedllvm/test/CodeGen/WebAssembly/masked-shifts.ll
Commit 0fd5e7b2d8ca4ed46d76187feb4b903ed0a3ea75 by tlively
[WebAssembly][lld] Fix segfault on .bss sections in mapfile

When memory is declared in the Wasm module, we rely on the implicit zero
initialization behavior and do not explicitly output .bss sections. The means
that they do not have associated `outputSec` entries, which was causing
segfaults in the mapfile support. Fix the issue by guarding against null
`outputSec` and falling back to using a zero offset.

Differential Revision: https://reviews.llvm.org/D102951
The file was modifiedlld/test/wasm/map-file.s
The file was modifiedlld/wasm/MapFile.cpp
Commit 963378bd8278220eb382bec76846ef39e4ea597e by Lang Hames
[ORC] Improve computeLocalDeps / computeNamedSymbolDependencies performance.

The computeNamedSymbolDependencies and computeLocalDeps methods on
ObjectLinkingLayerJITLinkContext are responsible for computing, for each symbol
in the current MaterializationResponsibility, the set of non-locally-scoped
symbols that are depended on. To calculate this we have to consider the effect
of chains of dependence through locally scoped symbols in the LinkGraph. E.g.

        .text
        .globl  foo
foo:
        callq   bar                    ## foo depneds on external 'bar'
        movq    Ltmp1(%rip), %rcx      ## foo depends on locally scoped 'Ltmp1'
        addl    (%rcx), %eax
        retq

        .data
Ltmp1:
        .quad   x                      ## Ltmp1 depends on external 'x'

In this example symbol 'foo' depends directly on 'bar', and indirectly on 'x'
via 'Ltmp1', which is locally scoped.

Performance of the existing implementations appears to have been mediocre:
Based on flame graphs posted by @drmeister (in #jit on the LLVM discord server)
the computeLocalDeps function was taking up a substantial amount of time when
starting up Clasp (https://github.com/clasp-developers/clasp).

This commit attempts to address the performance problems in three ways:

1. Using jitlink::Blocks instead of jitlink::Symbols as the nodes of the
dependencies-introduced-by-locally-scoped-symbols graph.

Using either Blocks or Symbols as nodes provides the same information, but since
there may be more than one locally scoped symbol per block the block-based
version of the dependence graph should always be a subgraph of the Symbol-based
version, and so faster to operate on.

2. Improved worklist management.

The older version of computeLocalDeps used a fixed worklist containing all
nodes, and iterated over this list propagating dependencies until no further
changes were required. The worklist was not sorted into a useful order before
the loop started.

The new version uses a variable work-stack, visiting nodes in DFS order and
only adding nodes when there is meaningful work to do on them.

Compared to the old version the new version avoids revisiting nodes which
haven't changed, and I suspect it converges more quickly (due to the DFS
ordering).

3. Laziness and caching.

Mappings of...

jitlink::Symbol* -> Interned Name (as SymbolStringPtr)
jitlink::Block* -> Immediate dependencies (as SymbolNameSet)
jitlink::Block* -> Transitive dependencies (as SymbolNameSet)

are all built lazily and cached while running computeNamedSymbolDependencies.

According to @drmeister these changes reduced Clasp startup time in his test
setup (averaged over a handful of starts) from 4.8 to 2.8 seconds (with
ORC/JITLink linking ~11,000 object files in that time), which seems like
enough to justify switching to the new algorithm in the absence of any other
perf numbers.
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h
The file was modifiedllvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
Commit d7afd11e3dc14d50156618cb27689f1425239c86 by Lang Hames
[ORC] Introduce ExecutorAddress type, fix broken LLDB bot.

ExecutorAddressRange depended on JITTargetAddress, but JITTargetAddress is
defined in ExecutionEngine, which OrcShared should not depend on.

This seems like as good a time as any to introduce a new ExecutorAddress type
to eventually replace JITTargetAddress. For now it's just another uint64_t
alias, but it will soon be changed to a class type to provide greater type
safety.
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/CommonOrcRuntimeTypes.h
Commit 511af1b1ad005af61ce792286a76633cd56ef7f9 by gysit
[mlir][linalg] Tighter StructuredOp Verification.

Verify the number of results matches exactly the number of output tensors. Simplify the FillOp verification since part of it got redundant.

Differential Revision: https://reviews.llvm.org/D105427
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/Dialect/Linalg/invalid.mlir
Commit 21fd8759529707b0f4430ebe8f27a01edc7f655e by mikael.holmen
[lld/mac] Fix warning about unused variable [NFC]

Change "dyn_cast" to "isa" to get rid of the unused
variable "bitcodeFile".

gcc warned with

lld/MachO/Driver.cpp:531:17: warning: unused variable 'bitcodeFile' [-Wunused-variable]
531 |       if (auto *bitcodeFile = dyn_cast<BitcodeFile>(file)) {
    |                 ^~~~~~~~~~~
The file was modifiedlld/MachO/Driver.cpp
Commit 9ced1e44adef3b329dde4c8f681d4d6b5825ea54 by sebastian.neubauer
[AMDGPU] Fix typo
The file was modifiedllvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp
Commit 684dfe8adb7eb6037b20e12364cae97c01ff2190 by zinenko
[mlir] factor out ConvertToLLVMPattern

This class and classes that extend it are general utilities for any dialect
that is being converted into the LLVM dialect. They are in no way specific to
Standard-to-LLVM conversion and should not make their users depend on it.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D105542
The file was addedmlir/include/mlir/Conversion/LLVMCommon/VectorPattern.h
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
The file was modifiedmlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
The file was modifiedmlir/lib/Conversion/GPUCommon/CMakeLists.txt
The file was modifiedmlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
The file was addedmlir/lib/Conversion/LLVMCommon/Pattern.cpp
The file was modifiedmlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
The file was modifiedmlir/lib/Conversion/OpenMPToLLVM/CMakeLists.txt
The file was modifiedmlir/lib/Conversion/LLVMCommon/CMakeLists.txt
The file was addedmlir/include/mlir/Conversion/LLVMCommon/Pattern.h
The file was addedmlir/lib/Conversion/LLVMCommon/VectorPattern.cpp
Commit 6c0fd4db79f2def432f761627bb8c7d4171a3237 by nicolas.vasilache
[mlir][MemRef] Fix DimOp folding of OffsetSizeAndStrideInterface.

This addresses the issue reported in

https://llvm.discourse.group/t/rank-reducing-memref-subview-offsetsizeandstrideopinterface-interface-issues/3805

Differential Revision: https://reviews.llvm.org/D105558
The file was modifiedmlir/include/mlir/IR/BuiltinTypes.h
The file was modifiedmlir/test/Dialect/Tensor/canonicalize.mlir
The file was modifiedmlir/lib/IR/BuiltinTypes.cpp
The file was modifiedmlir/test/Dialect/MemRef/canonicalize.mlir
The file was modifiedmlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
The file was modifiedmlir/lib/Dialect/Tensor/IR/TensorOps.cpp
Commit 84354b2ab20924b3807c0464308852e4568b63a3 by gysit
[mlir][linalg] Remove GenericOpBase.

Remove the GenericOpBase class formerly used to factor out common logic shared be GenericOp and IndexedGenericOp. After removing IndexedGenericOp, the base class is not used anymore.

Differential Revision: https://reviews.llvm.org/D105307
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
Commit abfa950d86da1737a7dd52ba262fa39dd2e937fa by gysit
[mlir][linalg][python] Add exp and log to the OpDSL.

Introduce the exp and log function in OpDSL. Add the soft plus operator to test the emitted IR in Python and C++.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D105420
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
The file was modifiedmlir/lib/Dialect/Linalg/IR/CMakeLists.txt
The file was modifiedmlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
The file was modifiedmlir/test/Dialect/Linalg/generalize-named-polymorphic-ops.mlir
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
Commit 715ca752ac4f8ba69fe68110823e0eabf5614bc7 by martin
[libcxx] [test] Fix spurious failures in the thread detach test on Windows

Make sure that the detached thread has started up before exiting
the process.

If the detached thread hasn't started up at all, and the main thread
exits, global data structures in the process are torn down, which
then can cause crashes when the thread starts up late after required
mutexes have been destroyed. (In particular, the mutex used internally
in _Init_thread_header, which is used in the initialization of
__thread_local_data()::__p, can cause crashes if the main thread already
has finished and progressed far with destruction.)

Differential Revision: https://reviews.llvm.org/D105592
The file was modifiedlibcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.member/detach.pass.cpp
Commit d58c7a92380e030af6e6f82ce55bc14a919f39ea by sichert
[IR] Added operator delete to subclasses of User to avoid UB

Several subclasses of User override operator new without also overriding
operator delete. This means that delete expressions fall back to using
operator delete of the base class, which would be User. However, this is
only allowed if the base class has a virtual destructor which is not the
case for User, so this is UB.

See also [expr.delete] (3) for the exact wording.

This is actually detected in some cases by GCC 11's
-Wmismatched-new-delete now which is how I found this error.

Differential Revision: https://reviews.llvm.org/D103143
The file was modifiedllvm/include/llvm/IR/InstrTypes.h
The file was modifiedllvm/include/llvm/IR/GlobalIndirectSymbol.h
The file was modifiedllvm/include/llvm/IR/Instructions.h
The file was modifiedllvm/lib/IR/ConstantsContext.h
The file was modifiedllvm/include/llvm/Analysis/MemorySSA.h
The file was modifiedllvm/include/llvm/IR/Constants.h
Commit 31f80393bc06f8eeab35218e1d4476bf120e452e by nicolas.vasilache
Revert "[mlir][MemRef] Fix DimOp folding of OffsetSizeAndStrideInterface."

This reverts commit 6c0fd4db79f2def432f761627bb8c7d4171a3237.

This simple implementation is unfortunately not extensible and needs to be reverted.
The extensible way should be to extend https://reviews.llvm.org/D104321.
The file was modifiedmlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
The file was modifiedmlir/lib/Dialect/Tensor/IR/TensorOps.cpp
The file was modifiedmlir/include/mlir/IR/BuiltinTypes.h
The file was modifiedmlir/lib/IR/BuiltinTypes.cpp
The file was modifiedmlir/test/Dialect/Tensor/canonicalize.mlir
The file was modifiedmlir/test/Dialect/MemRef/canonicalize.mlir
Commit 767eb9f9d5082b295cb7fe01d5e7d22fce72396a by mkazantsev
[Test] Add loop deletion switch tests

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D105543
The file was modifiedllvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
Commit 026bb84bcd42b875d77b769eb5ee4c19fc2a9719 by bradley.smith
[AArch64][SVE] Add ISel patterns for floating point compare with zero instructions

Additionally, lower the floating point compare SVE intrinsics to
SETCC_MERGE_ZERO ISD nodes to avoid duplicating ISel patterns.

Differential Revision: https://reviews.llvm.org/D105486
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/sve-intrinsics-fp-compares.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-masked-scatter.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
The file was modifiedllvm/lib/Target/AArch64/SVEInstrFormats.td
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-masked-gather.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-fcmp.ll
Commit ba913b8da57dcdcda0572ec3a6b8d4e367f22803 by chiahungduan
[mlir-reduce] Fix the memory leak and recycle unused modules.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D105416
The file was modifiedmlir/include/mlir/Reducer/ReductionNode.h
The file was modifiedmlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
The file was modifiedmlir/lib/Reducer/ReductionNode.cpp
Commit 7445f1e4dcd4525ab1f04f3cebfda341ec2eb716 by xndchn
[NFC] Mark Expected<T>::assertIsChecked() as const

Some const methods of Expected<T> invoke assertIsChecked(),
so we should mark it as const too.

Differential Revision: https://reviews.llvm.org/D105292
The file was modifiedllvm/include/llvm/Support/Error.h
The file was modifiedllvm/unittests/Support/ErrorTest.cpp
Commit 727e1c9be3a5b20c6b502f056d74a681689049d7 by Tim Northover
Support: add llvm::thread class that supports specifying stack size.

This adds a new llvm::thread class with the same interface as std::thread
except there is an extra constructor that allows us to set the new thread's
stack size. On Darwin even the default size is boosted to 8MB to match the main
thread.

It also switches all users of the older C-style `llvm_execute_on_thread` API
family over to `llvm::thread` followed by either a `detach` or `join` call and
removes the old API.
The file was modifiedllvm/unittests/Support/Threading.cpp
The file was modifiedllvm/lib/Support/Windows/Threading.inc
The file was modifiedllvm/lib/Support/Threading.cpp
The file was modifiedllvm/lib/Support/ThreadPool.cpp
The file was modifiedllvm/include/llvm/Support/CrashRecoveryContext.h
The file was modifiedllvm/lib/Support/CrashRecoveryContext.cpp
The file was modifiedllvm/include/llvm/Support/Threading.h
The file was modifiedllvm/include/llvm/Support/thread.h
The file was modifiedclang/tools/libclang/CIndex.cpp
The file was modifiedclang-tools-extra/clangd/support/Threading.cpp
The file was modifiedllvm/lib/Support/Unix/Threading.inc
Commit 2bf5e8d953ededbc208bd4c116c9d6331d73f0f0 by Tim Northover
Revert "Support: add llvm::thread class that supports specifying stack size."

It's causing build failures because DefaultStackSize isn't defined everywhere
it should be and I need time to investigate.
The file was modifiedllvm/lib/Support/ThreadPool.cpp
The file was modifiedllvm/include/llvm/Support/Threading.h
The file was modifiedllvm/lib/Support/CrashRecoveryContext.cpp
The file was modifiedllvm/lib/Support/Threading.cpp
The file was modifiedllvm/include/llvm/Support/thread.h
The file was modifiedllvm/lib/Support/Unix/Threading.inc
The file was modifiedllvm/lib/Support/Windows/Threading.inc
The file was modifiedclang-tools-extra/clangd/support/Threading.cpp
The file was modifiedllvm/include/llvm/Support/CrashRecoveryContext.h
The file was modifiedllvm/unittests/Support/Threading.cpp
The file was modifiedclang/tools/libclang/CIndex.cpp
Commit cc92833f8a3de7f6d4e301a1cb22adf2ffe94df4 by michael.hliao
[amdgpu] Remove the GlobalDCE pass prior to the internalization pass.

- In [D98783](https://reviews.llvm.org/D98783), an extra GlobalDCE pass
  is inserted before the internalization pass to ensure a global
  variable without users could be internalized even if there are dead
  users. Instead of inserting a dedicated optimization pass, the
  dead user checking, i.e. 'use_empty()', should be preceeded with
  constant dead user removal to ensure an accurate result.

Differential Revision: https://reviews.llvm.org/D105590
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
Commit 9320d4b695ffcf5a4d11bb3452c7502f04cb58ab by a.bataev
[Instcombine][NFC]Add a test for reduce+([sext/zext](<n x i1)) case, NFC.
The file was addedllvm/test/Transforms/InstCombine/reduction-add-sext-zext-i1.ll
Commit 3e6d2cbf268e66e350ebd321345c7d846933da68 by markus.boeck02
[mlir] Fully qualify types and expressions in Interfaces

This patch adds full qualification to the types and function calls used inside of (Static)InterfaceMethod in OpInterfaces. Without this patch using many of these interfaces in a downstream project yields compiler errors as the types and default implementations are mostly copied verbatim. Without then putting using namespace mlir; in the header file of the implementations of those interfaces, compilation is impossible.

Using fully qualified lookup fixes this issue.

Differential Revision: https://reviews.llvm.org/D105619
The file was modifiedmlir/include/mlir/Interfaces/CallInterfaces.td
The file was modifiedmlir/include/mlir/Interfaces/SideEffectInterfaceBase.td
The file was modifiedmlir/include/mlir/Interfaces/DataLayoutInterfaces.td
The file was modifiedmlir/include/mlir/Interfaces/DerivedAttributeOpInterface.td
The file was modifiedmlir/include/mlir/Interfaces/ViewLikeInterface.td
The file was modifiedmlir/include/mlir/Interfaces/CastInterfaces.td
The file was modifiedmlir/include/mlir/Interfaces/InferTypeOpInterface.td
The file was modifiedmlir/include/mlir/Interfaces/ControlFlowInterfaces.td
The file was modifiedmlir/include/mlir/Interfaces/VectorInterfaces.td
Commit 4e5d9c88033f1fc5d5206a02d8303bc6de43cf2b by michael.hliao
[Internalize] Preserve variables externally initialized.

- ``externally_initialized`` variables would be initialized or modified
  elsewhere. Particularly, CUDA or HIP may have host code to initialize
  or modify ``externally_initialized`` device variables, which may not
  be explicitly referenced on the device side but may still be used
  through the host side interfaces. Not preserving them triggers the
  elimination of them in the GlobalDCE and breaks the user code.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D105135
The file was modifiedclang/test/CodeGenCUDA/host-used-device-var.cu
The file was addedllvm/test/Transforms/Internalize/externally-initialized.ll
The file was modifiedclang/test/CodeGenCUDA/unused-global-var.cu
The file was modifiedllvm/lib/Transforms/IPO/Internalize.cpp
Commit b5113bff461b87fa214fa8fafdffd8eaaf8cf0e7 by a.bataev
[Instcombine]Transform reduction+(sext/zext(<n x i1>) to <n x im>) to [-]zext/trunc(ctpop(bitcast <n x i1> to in)) to im.

Some of the SPEC tests end up with reduction+(sext/zext(<n x i1>) to <n x im>) pattern, which can be transformed to [-]zext/trunc(ctpop(bitcast <n x i1> to in)) to im.
Also, reduction+(<n x i1>) can be transformed to ctpop(bitcast <n x i1> to in) & 1 != 0.

Differential Revision: https://reviews.llvm.org/D105587
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
The file was modifiedllvm/test/Transforms/InstCombine/reduction-add-sext-zext-i1.ll
Commit 48c68a630e06666101c16aa371f9202a4a53438b by Tim Northover
Recommit: Support: add llvm::thread class that supports specifying stack size.

This adds a new llvm::thread class with the same interface as std::thread
except there is an extra constructor that allows us to set the new thread's
stack size. On Darwin even the default size is boosted to 8MB to match the main
thread.

It also switches all users of the older C-style `llvm_execute_on_thread` API
family over to `llvm::thread` followed by either a `detach` or `join` call and
removes the old API.

Moved definition of DefaultStackSize into the .cpp file to hopefully
fix the build on some (GCC-6?) machines.
The file was modifiedllvm/lib/Support/CrashRecoveryContext.cpp
The file was modifiedclang-tools-extra/clangd/support/Threading.cpp
The file was modifiedclang/tools/libclang/CIndex.cpp
The file was modifiedllvm/lib/Support/ThreadPool.cpp
The file was modifiedllvm/lib/Support/Unix/Threading.inc
The file was modifiedllvm/lib/Support/Threading.cpp
The file was modifiedllvm/include/llvm/Support/thread.h
The file was modifiedllvm/unittests/Support/Threading.cpp
The file was modifiedllvm/include/llvm/Support/Threading.h
The file was modifiedllvm/lib/Support/Windows/Threading.inc
The file was modifiedllvm/include/llvm/Support/CrashRecoveryContext.h
Commit 4947ecf4e994fb72e90b8bf8d6ba110f7a862e1a by koraq
[libc++] Guard testing implementation details.

The unit tests test some implementation details. As @Quuxplusone pointed
out in D96664 this should only be tested when the tests use libc++. This
addresses the issue for code already in main.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D105568
The file was modifiedlibcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.pass.cpp
The file was modifiedlibcxx/test/std/utilities/format/format.formatter/format.parse.ctx/next_arg_id.pass.cpp
Commit 321c2ea91cb1aed5dfbbdbb868d525ff64972398 by koraq
[libc++][NFC] Move monostate to its own header.

The format library uses `std::monostate`, but not a `std::variant`.
Moving `std::monostate` to its own header allows the format library to
reduce the amount of included code.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D105582
The file was modifiedlibcxx/include/CMakeLists.txt
The file was addedlibcxx/include/__variant/monostate.h
The file was modifiedlibcxx/include/variant
The file was modifiedlibcxx/include/module.modulemap
Commit 87e41cc4b6c6bf22311f78e30c24ea92836bb021 by llvmgnsyncbot
[gn build] Port 321c2ea91cb1
The file was modifiedllvm/utils/gn/secondary/libcxx/include/BUILD.gn
Commit 63cc251eb949b7879919d505dbe375b1cd038781 by jeremy.morse
[DebugInfo][InstrRef][4/4] Support DBG_INSTR_REF through all backend passes

This is a cleanup patch -- we're now able to support all flavours of
variable location in instruction referencing mode. This patch updates
various tests for debug instructions to be broader: numerous code paths
try to ignore debug isntructions, and they now have to ignore the
additional DBG_PHI and DBG_INSTR_REFs that we can generate.

A small amount of rework happens for LiveDebugVariables: as we don't need
to track live intervals through regalloc any more, we can get away with
unlinking debug instructions before regalloc, then re-inserting them after.
Note that this isn't (yet) true of DBG_VALUE_LISTs, they still have to go
through live interval tracking.

In SelectionDAG, add a helper lambda that emits half-formed DBG_INSTR_REFs
for arguments in instr-ref mode, DBG_VALUE otherwise. This is one of the
final locations where DBG_VALUEs are emitted for vreg arguments.

X86InstrInfo now un-sets the debug instr number on SUB instructions that
get mutated into CMP instructions. As the instruction no longer computes a
subtraction, we can't use it for variable locations.

Differential Revision: https://reviews.llvm.org/D88898
The file was modifiedllvm/test/DebugInfo/MIR/InstrRef/phi-through-regalloc.mir
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
The file was addedllvm/test/DebugInfo/MIR/InstrRef/x86-drop-compare-inst.mir
The file was modifiedllvm/lib/CodeGen/LiveDebugVariables.cpp
The file was modifiedllvm/lib/CodeGen/MachineSink.cpp
The file was modifiedllvm/lib/CodeGen/LiveIntervals.cpp
The file was modifiedllvm/test/DebugInfo/MIR/InstrRef/phi-regallocd-to-stack.mir
The file was modifiedllvm/lib/CodeGen/RegisterPressure.cpp
The file was modifiedllvm/test/DebugInfo/MIR/InstrRef/phi-coalescing.mir
The file was modifiedllvm/lib/Target/X86/X86InstrInfo.cpp
The file was modifiedllvm/lib/CodeGen/ScheduleDAGInstrs.cpp
The file was modifiedllvm/lib/CodeGen/RegisterCoalescer.cpp
The file was modifiedllvm/test/DebugInfo/MIR/InstrRef/phi-coalesce-subreg.mir
Commit 6afd6e96ce203ca6b2840df48e939434237bf82e by Louis Dionne
[libc++] Workaround failures with modules on Clang ToT
The file was modifiedlibcxx/include/__iterator/advance.h
The file was modifiedlibcxx/include/__iterator/next.h
The file was modifiedlibcxx/include/__iterator/prev.h
The file was modifiedlibcxx/test/support/test_standard_function.h
Commit a276f451804463fd663eaeac86aea1e24a356247 by Louis Dionne
[libc++][docs] Update documentation to reflect libc++'s compiler support policy

In https://lists.llvm.org/pipermail/llvm-dev/2021-March/148881.html, we
discussed updating the compiler support policy for libc++ to match more
closely what we do actually support.

This commit enshrines that policy decision in libc++'s documentation.

Differential Revision: https://reviews.llvm.org/D105563
The file was modifiedlibcxx/docs/index.rst
Commit 83a87b831a11d99d3c986c0c285f4688119e8831 by nikita.ppv
[IR] Restore vector support for deprecated CreateGEP methods

As pointed out in post-commit review on rG8e22539067d9, it's
necessary to call getScalarType() to support GEPs with a vector
base. Dropping that call was an oversight on my side.
The file was modifiedllvm/include/llvm/IR/Instructions.h
The file was modifiedllvm/include/llvm/IR/IRBuilder.h
Commit d2a8d362c592b2f1918a0f8dca7442f9dd44fe82 by Louis Dionne
[libc++][ci] Stop testing on GCC previous, since we don't support it anymore

This is the first of a few commits that update the CI to match the
recently officialized compiler support policy. I'm staging those
changes to try and keep the CI green at all times, accounting how
builders refresh their Docker image.
The file was modifiedlibcxx/utils/ci/run-buildbot
The file was modifiedlibcxx/utils/ci/buildkite-pipeline.yml
Commit 74a5760d35e2e75a295793e09260120ef0c5f4ea by Stanislav.Mekhanoshin
[AMDGPU] Set LoopInfo as preserved by SIAnnotateControlFlow

The pass does not change loops, it just adds calls.

Differential Revision: https://reviews.llvm.org/D105583
The file was modifiedllvm/test/CodeGen/AMDGPU/llc-pipeline.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp
Commit 8cf60e61e7b0e3213b5b81039878dcf1ef18c00f by ajcbik
[mlir][sparse] updated setter/getter comments

For the getters, it is bad practice to keep the reference
around for too long, as explained in the new comment

Reviewed By: gussmith23

Differential Revision: https://reviews.llvm.org/D105599
The file was modifiedmlir/include/mlir/Dialect/SparseTensor/Utils/Merger.h
Commit c34b0ab589e5760b1eb82bf1f289590d351ea3c6 by i
[LangRef] Clarify !associated

Notably, a global variable with the metadata should generally not be referenced
by a function function. E.g. -fstack-size-section usage is fine, but
-fsanitize-coverage= used to have a linker GC problem (fixed by D97430).

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D104933
The file was modifiedllvm/docs/LangRef.rst
Commit 8ef67fa9d22952dba578fed318a7cb520c50a09b by llvm-dev
[CostModel][X86] Account for older SSE targets with slow fp->int conversions

Both the conversion cost and the xmm->gpr transfer cost tend to be a lot higher on early SSE targets
The file was modifiedllvm/lib/Target/X86/X86TargetTransformInfo.cpp
The file was modifiedllvm/test/Analysis/CostModel/X86/fptoui.ll
The file was modifiedllvm/test/Analysis/CostModel/X86/fptosi.ll
Commit 769e782793391a1ee0d257c8b0c6f43a02321e22 by llvm-dev
Fix MSVC "truncation from 'int' to 'bool'" warning. NFCI.
The file was modifiedclang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
Commit 5b350183cdabd83573bc760ddf513f3e1d991bcb by efriedma
[ScalarEvolution] Fix overflow in computeBECount.

There are two issues with the current implementation of computeBECount:

1. It doesn't account for the possibility that adding "Stride - 1" to
Delta might overflow. For almost all loops, it doesn't, but it's not
actually proven anywhere.
2. It doesn't account for the possibility that Stride is zero. If Delta
is zero, the backedge is never taken; the value of Stride isn't
relevant. To handle this, we have to make sure that the expression
returned by computeBECount evaluates to zero.

To deal with this, add two new checks:

1. Use a variety of tricks to try to prove that the addition doesn't
overflow.  If the proof is impossible, use an alternate sequence which
never overflows.
2. Use umax(Stride, 1) to handle the possibility that Stride is zero.

Differential Revision: https://reviews.llvm.org/D105216
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/test/Analysis/ScalarEvolution/trip-count-unknown-stride.ll
The file was modifiedllvm/include/llvm/Analysis/ScalarEvolution.h
The file was modifiedllvm/test/Analysis/ScalarEvolution/2008-11-18-Stride1.ll
The file was modifiedllvm/test/Analysis/ScalarEvolution/2008-11-18-Stride2.ll
Commit a11aea68a4b31e72bc0b84bde5f3210048287d28 by leonardchan
[compiler-rt][hwasan] Define fuchsia implementations of required hwasan functions

This contains all the definitions required by hwasan for the fuchsia
implementation and can be landed independently from the remaining parts of D91466.

Differential Revision: https://reviews.llvm.org/D103936
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
The file was modifiedcompiler-rt/lib/hwasan/hwasan_fuchsia.cpp
Commit d833543dd52cfb126f4c6d765166e42da217b72a by i
[LangRef] Fix typo about SHF_LINK_ORDER
The file was modifiedllvm/docs/LangRef.rst
Commit 2f9504aa419b27d45e87db77476b9cf17feee4fb by Matthew.Arsenault
Mips/GlobalISel: Use correct callee calling convention

This was using the convention from the calling function.
The file was modifiedllvm/lib/Target/Mips/MipsCallLowering.cpp
Commit 9b057f647d70fc958d4a1a7a00e2debaf72127c1 by Matthew.Arsenault
GlobalISel: Track original argument index in ArgInfo

SelectionDAG's equivalents in ISD::InputArg/OutputArg track the
original argument index. Mips relies on this, and its currently
reinventing its own parallel CallLowering infrastructure which tracks
these indexes on the side. Add this to help move towards deleting the
custom mips handling.
The file was modifiedllvm/lib/Target/ARM/ARMLegalizerInfo.cpp
The file was modifiedllvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/CallLowering.cpp
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
The file was modifiedllvm/lib/Target/PowerPC/GISel/PPCCallLowering.cpp
The file was modifiedllvm/lib/Target/ARM/ARMCallLowering.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
The file was modifiedllvm/lib/Target/Mips/MipsCallLowering.cpp
The file was modifiedllvm/lib/Target/X86/X86CallLowering.cpp
Commit 43f25e61cec0ac2aaf38b550e3c98f503dd3a8d3 by Matthew.Arsenault
Mips/GlobalISel: Remove custom splitToValueTypes
The file was modifiedllvm/lib/Target/Mips/MipsCallLowering.cpp
The file was modifiedllvm/lib/Target/Mips/MipsCallLowering.h
Commit 9dae86ce56f16d76afa6feb98123cd130b01a6c3 by Stanislav.Mekhanoshin
[AMDGPU] Fix indention in llc-pipeline test. NFC.
The file was modifiedllvm/test/CodeGen/AMDGPU/llc-pipeline.ll
Commit 8c7ff9da9039089a89f5b076c267a3efb5da161c by michael.hliao
[Metadata] Decorate methods with 'const'. NFC.

- Minor coding style fix.
The file was modifiedllvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
The file was modifiedllvm/include/llvm/IR/Metadata.h
Commit 4747e1b83ba0117a88551a358f8960060ffa7558 by nicolas.vasilache
[mlir][Linalg] Fix tensor.extract_slice(linalg.init_tensor) canonicalization for rank-reducing extract

Differential Revision: https://reviews.llvm.org/D105636
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/Dialect/Linalg/canonicalize.mlir
Commit 8ea2b951c65645ea803d4797dacbb8077b3aa629 by Louis Dionne
[libc++][ci] Install Clang 11, Clang 12 and Clang ToT in the Docker image

The compiler support policy mentions that we support Clang 11 and 12, so
we should test those. We already test on Clang 12, but I'll add testers
for Clang 11 once the new Docker image is in use on all the builders.
The file was modifiedlibcxx/utils/ci/Dockerfile
Commit de5582be26b771c31e4333520c12ea65cec03ee5 by Stanislav.Mekhanoshin
[AMDGPU] Fix more indention in llc-pipeline test. NFC.
The file was modifiedllvm/test/CodeGen/AMDGPU/llc-pipeline.ll
Commit 5a1c50410ccc1973a1a0a4acca0c01677c28e9b6 by mizvekov
[clang] fix constexpr code generation for user conversions.

When building the member call to a user conversion function during an
implicit cast, the expression was not being checked for immediate
invocation, so we were never adding the ConstantExpr node to AST.

This would cause the call to the user conversion operator to be emitted
even if it was constantexpr evaluated, and this would even trip an
assert when said user conversion was declared consteval:
`Assertion failed: !cast<FunctionDecl>(GD.getDecl())->isConsteval() && "consteval function should never be emitted", file clang\lib\CodeGen\CodeGenModule.cpp, line 3530`

Fixes PR48855.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D105446
The file was modifiedclang/lib/AST/Expr.cpp
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was modifiedclang/test/CodeGenCXX/cxx2a-consteval.cpp
Commit 9d826fdb284e9010450d4c4c577e4690124d35cc by a.bataev
[X86][NFC]Add run lines for AVX512VL for masked gather test, NFC.
The file was modifiedllvm/test/CodeGen/X86/masked_gather.ll
Commit 693251fb2f001ac06591ae7d1254be265d36c9c7 by nikita.ppv
[CodeGen] Avoid CreateGEP with nullptr type (NFC)

In preparation for dropping support for it. I've replaced it with
a proper type where the correct type was obvious and left an
explicit getPointerElementType() where it wasn't.
The file was modifiedclang/lib/CodeGen/CGObjCGNU.cpp
The file was modifiedclang/lib/CodeGen/CGCall.cpp
The file was modifiedclang/lib/CodeGen/ItaniumCXXABI.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.cpp
Commit 74fb868942c8c126a69a09c0503041b7573f68e0 by Louis Dionne
[libc++] Add XFAIL for Clang ToT with modules

This is what I should have done instead of 6afd6e96ce20.
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/special_function.compile.pass.cpp
The file was modifiedlibcxx/include/__iterator/next.h
The file was modifiedlibcxx/include/__iterator/prev.h
The file was modifiedlibcxx/include/__iterator/advance.h
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/special_function.compile.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/special_function.compile.pass.cpp
Commit 6dd94cbff55afeb1b9692d0f21d08b79eae16a29 by craig.topper
[ARM] Use matchSimpleRecurrence to simplify some code in MVEGatherScatterLowering. NFCI

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D105262
The file was modifiedllvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
Commit 0d74fd3fdf5013e72c9c1682a284b8de7973a805 by a.bataev
[SLP][COST][X86]Improve cost model for masked gather.

Revived D101297 in its original form + added some changes in X86
legalization cehcking for masked gathers.

This solution is the most stable and the most correct one. We have to
check the legality before trying to build the masked gather in SLP.
Without this check we have incorrect cost (for SLP) in case if the masked gather
is not legal/slower than the gather. And we're missing some
vectorization opportunities.

This can be fixed in the cost model, but in this case we need to add
special checks for the cost of GEPs for ScatterVectorize node, add
special check for small trees, etc., i.e. there are a lot of corner
cases here and there, which insrease code base and make it harder to
maintain the code.

> Can't we rely on cost model to deal with this? This can be profitable for futher vectorization, when we can start from such gather loads as seed.

The question from D101297. Actually, no, it can't. Actually, simple
gather may give us better result, especially after we started
vectorization of insertelements. Plus, like I said before, the cost for
non-legal masked gathers leads to missed vectorization opportunities.

Differential Revision: https://reviews.llvm.org/D105042
The file was modifiedllvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/pr47629.ll
The file was modifiedllvm/test/CodeGen/X86/masked_gather_scatter_widen.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/pr47629-inseltpoison.ll
The file was modifiedllvm/lib/Target/X86/X86TargetTransformInfo.cpp
The file was modifiedllvm/test/CodeGen/X86/masked_gather_scatter.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/lookahead.ll
The file was modifiedllvm/test/CodeGen/X86/masked_gather.ll
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/memory-runtime-checks.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/pr47623.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/stores-non-ordered.ll
Commit f57d396dcab2a280faa72aff68623a8ccfdc5421 by a.bataev
[OPENMP]Do no privatize const firstprivates in target regions.

No need to emit private copyfor firstprivate constants in target
regions, we can use the original copy instead.

Differential Revision: https://reviews.llvm.org/D105647
The file was modifiedclang/lib/CodeGen/CGStmtOpenMP.cpp
The file was modifiedclang/test/OpenMP/target_firstprivate_codegen.cpp
The file was modifiedclang/test/OpenMP/nvptx_target_firstprivate_codegen.cpp
Commit b5a7da43916ca61d7449892a2bb8ffa784953693 by nikita.ppv
[NVPTX] Pass explicit GEP type (NFC)

Use source element type of original GEP, as we're just changing
the address space.
The file was modifiedllvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
Commit cfb94212d49a1a28208b09bb7d80b86956854b4b by nikita.ppv
[AMDGPU] Pass explicit GEP type in printf transform (NFC)

This code is working on an i8*. Avoid nullptr element type in
preparation for removing support.
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
Commit 9e225a2a71ce43cb74283d3bcf8c9d1eb7c30bd4 by nikita.ppv
[AMDGPU] Simplify GEP construction (NFC)

Noticed while making a related change. This code was doing
something really peculiar: Creating an APInt by parsing a string.
And then creating a SmallVector with one element to create the
GEP.

Instead create the APInt from integers and directly pass the single
index to GetElementPtrInst::Create().
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
Commit a0ea3675629a1aecc60326e5439d811956b0f92a by nikita.ppv
[CodeGen] Avoid nullptr arg to CreateStructGEP (NFC)

For now just make the getPointerElementType() explicit.
The file was modifiedclang/lib/CodeGen/CGCall.cpp
Commit c574d2fbaca4412c2b758f9049acdb794b2c8764 by a.bataev
[SLP]Improve vectorization of stores.

Patch tries to improve the vectorization of stores. Originally, we just
check the type and the base pointer of the store.
Patch adds some extra checks to avoid non-profitable vectorization
cases. It includes analysis of the scalar values to be stored and
triggers the vectorization attempt only if the scalar values have
same/alt opcode and are from same basic block, i.e. we don't end up
immediately with the gather node, which is not profitable.
This also improves compile time by filtering out non-profitable cases.

Part of D57059.

Differential Revision: https://reviews.llvm.org/D104122
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/stores-non-ordered.ll
Commit ccc6f487d8df42a4bf1e5a1b411881a15f7dac82 by Vitaly Buka
[msan] Add funel shift tests

For https://bugs.llvm.org/show_bug.cgi?id=50840
The file was addedllvm/test/Instrumentation/MemorySanitizer/funnel_shift.ll
Commit 915e07605cd5db58db2ea9dd0d2a0a921206d01e by Vitaly Buka
[msan] Handle funnel shifts

Fixes https://bugs.llvm.org/show_bug.cgi?id=50840

Differential Revision: https://reviews.llvm.org/D105387
The file was modifiedllvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
The file was modifiedllvm/test/Instrumentation/MemorySanitizer/funnel_shift.ll
Commit d458f379324967c3c408be06e21aad9bc92c54cb by 31459023+hctim
[GWP-ASan] Change unreachable -> trap to work around DCE bug.

trapOnAddress is designed to SEGV on a specific address. Unfortunately,
with an IR change, __builtin_unreachable() ends up doing DCE on things
that have side effects, like the load that causes the trap.

Change to __builtin_trap() to avoid the optimisation.

Root cause is still an LLVM bug, and tracked in
https://bugs.llvm.org/show_bug.cgi?id=47480.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D105654
The file was modifiedcompiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp
Commit a7992b43a54f89dca7b76cb79d1045acce6dbe1f by leonardchan
[NFC][compiler-rt][fuchsia] Add InitShadowBounds declaration to header

Forgot to include this as a part of
a11aea68a4b31e72bc0b84bde5f3210048287d28.
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_fuchsia.h
Commit 1def2579e10dd84405465f403e8c31acebff0c97 by dblaikie
PR51018: Remove explicit conversions from SmallString to StringRef to future-proof against C++23

C++23 will make these conversions ambiguous - so fix them to make the
codebase forward-compatible with C++23 (& a follow-up change I've made
will make this ambiguous/invalid even in <C++23 so we don't regress
this & it generally improves the code anyway)
The file was modifiedllvm/unittests/Support/CommandLineTest.cpp
The file was modifiedllvm/unittests/Support/LockFileManagerTest.cpp
The file was modifiedclang/lib/Lex/HeaderSearch.cpp
The file was modifiedllvm/tools/llvm-readobj/COFFDumper.cpp
The file was modifiedllvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
The file was modifiedclang/lib/Lex/PPDirectives.cpp
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedlldb/source/Commands/CommandCompletions.cpp
The file was modifiedclang/lib/AST/MicrosoftMangle.cpp
The file was modifiedclang/lib/CrossTU/CrossTranslationUnit.cpp
The file was modifiedclang/unittests/Frontend/FrontendActionTest.cpp
The file was modifiedllvm/lib/Transforms/Scalar/MergeICmps.cpp
The file was modifiedllvm/unittests/DebugInfo/DWARF/DWARFDieManualExtractTest.cpp
The file was modifiedclang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
The file was modifiedclang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
The file was modifiedllvm/tools/llvm-exegesis/lib/Analysis.cpp
The file was modifiedclang/lib/Analysis/MacroExpansionContext.cpp
The file was modifiedllvm/lib/MC/MCContext.cpp
The file was modifiedclang-tools-extra/clangd/JSONTransport.cpp
The file was modifiedllvm/lib/Support/Signals.cpp
The file was modifiedclang/lib/Basic/FileManager.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
The file was modifiedllvm/lib/LTO/LTOModule.cpp
The file was modifiedclang-tools-extra/clangd/Selection.cpp
The file was modifiedclang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
The file was modifiedclang/lib/CodeGen/MicrosoftCXXABI.cpp
The file was modifiedclang/tools/clang-scan-deps/ClangScanDeps.cpp
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedllvm/lib/Support/VirtualFileSystem.cpp
The file was modifiedllvm/unittests/Bitstream/BitstreamWriterTest.cpp
The file was modifiedmlir/lib/Tools/mlir-lsp-server/lsp/Transport.cpp
The file was modifiedllvm/lib/Support/CommandLine.cpp
The file was modifiedllvm/lib/Transforms/Utils/MemoryOpRemark.cpp
The file was modifiedllvm/lib/IR/ValueSymbolTable.cpp
The file was modifiedclang-tools-extra/clang-doc/HTMLGenerator.cpp
The file was modifiedclang/lib/Driver/ToolChains/AMDGPU.cpp
The file was modifiedclang-tools-extra/clangd/QueryDriverDatabase.cpp
The file was modifiedclang/lib/Sema/SemaStmt.cpp
The file was modifiedllvm/lib/Object/IRSymtab.cpp
Commit e2d30846327c7ec5cc9d2a46aa9bcd9c2c4eff93 by dblaikie
PR51018: Disallow explicit construction of StringRef from SmallString due to ambiguity in C++23

See bug for full details, but basically there's an upcoming ambiguity in
the conversion in `StringRef(SomeSmallString)` - either the implicit
conversion operator (SmallString::operator StringRef) could be used, or
the std::string_view range-based ctor (& then `StringRef(std::string_view)`
would be used)

To address this, make such a conversion invalid up-front - most uses are
more tersely written as `SomeSmallString.str()` anyway, or more clearly
written as `StringRef x = y;` rather than `StringRef x(y);` - so if you
hit this in out-of-tree code, please update in one of those ways.
Hopefully I've fixed everything in tree prior to this patch landing.
The file was modifiedllvm/include/llvm/ADT/SmallString.h
Commit c9a0e74697778a7f2d5da2a22fe56a3eec2ec9a8 by dblaikie
Revert "PR51018: Disallow explicit construction of StringRef from SmallString due to ambiguity in C++23"

This reverts commit e2d30846327c7ec5cc9d2a46aa9bcd9c2c4eff93.

MSVC doesn't seem to resolve the intended ambiguity in implicit
conversion contexts correctly: https://godbolt.org/z/ee16aqv4v
The file was modifiedllvm/include/llvm/ADT/SmallString.h
Commit 82563d8d14b6177351c26a6750c79a9d21a9cd73 by rob.suderman
[mlir][bazel] Added missing MathDialect dep to LinalgOps target

LinalgOps needs MathDialect as a dependency for it to build correctly.

Differential Revision: https://reviews.llvm.org/D105656
The file was modifiedutils/bazel/llvm-project-overlay/mlir/BUILD.bazel
Commit 8af69975af39867187dabc5a9e68ad68b53c46f9 by a.bataev
[InstCombine][NFC]Use only `replaceInstUsesWith`, NFC.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
Commit e2bc88f175400e06dffd217a86841d069870fb30 by david.green
[ARM] Extra v8i16 -> i64 reduction tests with loads. NFC
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vecreduce-mla.ll
Commit 3dd75f53710683fe3616eb64a2c1865ade43b3f7 by tlively
[WebAssembly] Scalarize extract_vector_elt of binops

Override the `shouldScalarizeBinop` target lowering hook using the same
implementation used in the x86 backend. This causes `extract_vector_elt`s of
vector binary ops to be scalarized if the scalarized version would be supported.

Differential Revision: https://reviews.llvm.org/D105646
The file was modifiedllvm/test/CodeGen/WebAssembly/masked-shifts.ll
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
Commit 7c35aae35b2c386b59af58c56ed36908f3d68371 by silvasean
Mark TensorDialect legal and PadTensor op illegal

`GeneralizePadTensorOpPattern` might generate `tensor.dim` op so the
TensorDialect should be marked legal. This pattern should also
transform all `linalg.pad_tensor` ops so mark those as illegal. Those
changes are missed from a previous change in
https://reviews.llvm.org/D105293

Reviewed By: silvas

Differential Revision: https://reviews.llvm.org/D105642
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp
The file was modifiedmlir/test/Dialect/Linalg/bufferize.mlir
Commit 631516301ea34f5e16dc13134037f2d748248606 by craig.topper
[ARM] Pass 2 instead of 0 to PHINode::Create in MVEGatherScatterLowering. NFC

This parameter controls how much space is reserved for incoming
values. There are always going to be 2 incoming values in this case.

While there remove the unused std::vector right below.

Found while looking at porting this code to RISCV.
The file was modifiedllvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
Commit e5b0fe1b834779e7ecb81755b2f4019f689fea58 by Stanislav.Mekhanoshin
[AMDGPU] Mark more SOP instructions as rematerializable

The rest of the SOP instructions implicitly set SCC and not
suitable for the rematerialization.

Differential Revision: https://reviews.llvm.org/D105670
The file was modifiedllvm/lib/Target/AMDGPU/SOPInstructions.td
The file was addedllvm/test/CodeGen/AMDGPU/remat-sop.mir
Commit 0d0cff3ace39378acfc66d6564dc99e19b8a561f by gusss
[mlir][sparse] Add Merger unit tests

We opt to use unit tests rather than check tests as the lattice/merger code is a small C++ component with a well-defined API. Testing this API via check tests would be far less direct and readable. In addition, as the check tests will only be able to test the API indirectly, the tests may break based on unrelated changes; e.g. changes in linalg.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D104956
The file was modifiedmlir/unittests/Dialect/CMakeLists.txt
The file was addedmlir/unittests/Dialect/SparseTensor/CMakeLists.txt
The file was addedmlir/unittests/Dialect/SparseTensor/MergerTest.cpp
Commit 0eb2b13d609c3225d1146bf7a9ef03340061c95d by Yuanfang Chen
Add AddDiscriminatorsPass to NPM default O0 pipeline

AddDiscriminatorsPass is in Legacy PM's O0 pipeline. This patch did the same
for NPM O0 pipeline.

Reviewed By: aeubanks, MaskRay

Differential Revision: https://reviews.llvm.org/D105650
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
The file was modifiedllvm/test/Other/new-pm-O0-defaults.ll
Commit 1dc005aa7dc51131515894cbd34f27d6b361f23e by kda
Add documentation for -fsanitize-address-use-after-return.

for issue: https://github.com/google/sanitizers/issues/1394

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D104155
The file was modifiedclang/docs/AddressSanitizer.rst
The file was modifiedclang/docs/UsersManual.rst
The file was modifiedclang/include/clang/Driver/Options.td
Commit 70eb3bfff0ac8c882d793cc171e1230cf313b49d by chiahungduan
[mlir-reduce] Fix the grammer in the doc

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D105623
The file was modifiedmlir/docs/Tools/mlir-reduce.md
Commit 009436e9c1fee1290d62bc0faafe0c0295542f56 by efriedma
[NFC][ScalarEvolution] Cleanup howManyLessThans.

In preparation for D104075. Some NFC cleanup, and some test coverage for
planned changes.
The file was modifiedllvm/test/Analysis/ScalarEvolution/lt-overflow.ll
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/test/Analysis/ScalarEvolution/max-trip-count.ll
The file was modifiedllvm/include/llvm/Analysis/ScalarEvolution.h
The file was modifiedllvm/test/Analysis/ScalarEvolution/trip-count13.ll
Commit 38451fa1789cd42fe4c1ed8ac519620892e4634d by joker.eph
Revert "[mlir][sparse] Add Merger unit tests"

This reverts commit 0d0cff3ace39378acfc66d6564dc99e19b8a561f.

The build is broken with GCC 5.4
The file was removedmlir/unittests/Dialect/SparseTensor/MergerTest.cpp
The file was removedmlir/unittests/Dialect/SparseTensor/CMakeLists.txt
The file was modifiedmlir/unittests/Dialect/CMakeLists.txt
Commit ed102ce20a5f5ddf388bc71217228b756e2f5fe3 by powerman1st
[RISCV][test] Add new tests for mul optimization in the zba extension with SH*ADD

This patch will show the following optimization by future patches.

(mul x imm) -> (SH1ADD x, (SLLI x, bits)) when imm = 2^n + 2.
(mul x imm) -> (SH2ADD x, (SLLI x, bits)) when imm = 2^n + 4.
(mul x imm) -> (SH3ADD x, (SLLI x, bits)) when imm = 2^n + 8.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D105614
The file was modifiedllvm/test/CodeGen/RISCV/rv32zba.ll
The file was modifiedllvm/test/CodeGen/RISCV/rv64zba.ll
Commit 2e194dec6076d06ccb40f50a1718e2250255a3dc by Reshabhkumar.Sharma
[ASan][AMDGPU] Make shadow offset match X86 on Linux

This patch explicitly sets the shadow offset for
AMDGPU to match that of X86 on Linux.

Reviewed By: vitalybuka

https://reviews.llvm.org/D105282
The file was modifiedllvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
The file was modifiedllvm/test/Instrumentation/AddressSanitizer/AMDGPU/asan_instrument_global_address_space.ll
The file was modifiedllvm/test/Instrumentation/AddressSanitizer/AMDGPU/asan_instrument_generic_address_space.ll
The file was modifiedllvm/test/Instrumentation/AddressSanitizer/AMDGPU/asan_instrument_constant_address_space.ll
Commit 932e3d9960c115d0f6a92b6b4c9529892ade8d32 by omair.javaid
Revert "GlobalISel/AArch64: don't optimize away redundant branches at -O0"

This reverts commit 458c230b5ef893238d2471fcff27cd275e8026d5.

This broke LLDB buildbot testcase where breakpoint set at start of loop
failed to hit. https://lab.llvm.org/buildbot/#/builders/96/builds/9404

https://github.com/llvm/llvm-project/blob/main/lldb/test/API/commands/process/attach/main.cpp#L15

Differential Revision: https://reviews.llvm.org/D105238
The file was modifiedllvm/test/CodeGen/Mips/GlobalISel/llvm-ir/long_ambiguous_chain_s32.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
The file was removedllvm/test/DebugInfo/AArch64/fallthrough-branch.ll
The file was modifiedllvm/test/CodeGen/Mips/GlobalISel/llvm-ir/jump_table_and_brjt.ll
The file was modifiedllvm/test/CodeGen/Mips/GlobalISel/llvm-ir/phi.ll
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/arm64-atomic.ll
The file was modifiedllvm/test/CodeGen/AArch64/unwind-preserved.ll
The file was modifiedllvm/test/CodeGen/Mips/GlobalISel/llvm-ir/long_ambiguous_chain_s64.ll
Commit 5553d83adac68c80226bc626feb14f9c24d9f886 by echristo
Update Bazel overlay in GPUToGPURuntimeTransforms.
The file was modifiedutils/bazel/llvm-project-overlay/mlir/BUILD.bazel
Commit 55bd12d4b7eeed5d2909de4babaead12396c521c by lkail
[PowerPC] Remove implicit use register after transformToImmFormFedByLI()

When the instruction has imm form and fed by LI, we can remove the redundat LI instruction.
Below is an example:
```
    renamable $x5 = LI8 2
    renamable $x4 = exact SRD killed renamable $x4, killed renamable $r5, implicit $x5
```

will be converted to:
```
   renamable $x5 = LI8 2
   renamable $x4 = exact RLDICL killed renamable $x4, 62, 2,  implicit killed $x5
```

But when we do this optimization, we forget to remove implicit killed $x5
This bug has caused a lnt case error. This patch is to fix above bug.

Reviewed By: #powerpc, shchenz

Differential Revision: https://reviews.llvm.org/D85288
The file was addedllvm/test/CodeGen/PowerPC/remove-redundant-li-implicit-reg.mir
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.cpp
Commit 62cc3cdda64aaaca5bfeba4b131ab6b5f50b4e0c by i
[CMake] Disable -fno-semantic-interposition for GCC<10.3 on SystemZ

`-fno-semantic-interposition` was added for GCC in D102453, but some MLIR tests
on SystemZ failed with GCC<10.3 due to a bug.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D105453
The file was modifiedllvm/cmake/modules/HandleLLVMOptions.cmake
Commit 88326bbce38c53f4782ba3b593b6720438a9569c by powerman1st
[RISCV][clang] Add macro __riscv_zvlsseg for RVV Zvlsseg builtins

Add extension macro __riscv_zvlsseg to enable Zvlsseg builtins only
with target feature Zvlsseg.

Reviewed By: HsiangKai

Differential Revision: https://reviews.llvm.org/D105626
The file was modifiedclang/utils/TableGen/RISCVVEmitter.cpp
The file was modifiedclang/test/CodeGen/RISCV/rvv-intrinsics/vlsegff.c
The file was modifiedclang/test/CodeGen/RISCV/rvv-intrinsics/vlseg.c
The file was modifiedclang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vlsegff.c
The file was modifiedclang/test/CodeGen/RISCV/rvv-intrinsics-overloaded/vlseg.c