Changes

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [lld/mac] Make a variable more local; no behavior change (details)
  2. [clang] NFC: adjust indentation of statements with more than one lines (details)
  3. [LoopDeletion] Handle Phis with similar inputs from different blocks (details)
  4. [yaml2obj] Add support for writing the long symbol name. (details)
  5. [clangd] Type hints for C++14 return type deduction (details)
  6. [Test] Add some tests showing room for optimization exploiting undef and UB (details)
  7. [AMDGPU][Libomptarget] Remove redundant functions (details)
  8. [AMDGPU] Replace non-kernel function uses of LDS globals by pointers. (details)
  9. [gn build] Port 80fd5fa5269c (details)
  10. [mlir][Linalg] Introduce a BufferizationAliasInfo (6/n) (details)
  11. [mlir][Linalg] NFC - Drop unused variable definition. (details)
  12. [AMDGPU] Add Optimize VGPR LiveRange Pass. (details)
  13. [gn build] Port 208332de8abf (details)
  14. [mlir][linalg] Support low padding in subtensor(pad_tensor) lowering (details)
  15. [FuncSpec] Don't specialise functions with NoDuplicate instructions. (details)
  16. [InstCombine] Fold icmp (select c,const,arg), null if icmp arg, null can be simplified (details)
  17. [Mem2Reg] Regenerate test checks (NFC) (details)
  18. [Mem2Reg] Use poison for unreachable cases (details)
  19. [mlir][NFC] Remove Standard dialect dependency on MemRef dialect (details)
  20. [Mem2Reg] Regenerate test checks (NFC) (details)
  21. [AMDGPU] Fix linking with shared libraries (details)
  22. [lldb] Assert that CommandResultObject error messages are not empty (details)
  23. [VP][NFCI] Address various clang-tidy warnings (details)
  24. [mlir][Linalg] Silence warnings in Release builds. NFC. (details)
  25. [NFC] Wrap entire assert-only block in LLVM_DEBUG (details)
  26. [mlir][ODS] Fix copy ctor for generate Pass classes (details)
  27. [LoopIdiom] Add test case that involves adds with flags and zero exts. (details)
  28. [lldb][NFC] Remove redundant deleted constructors in HostInfoBase subclasses (details)
  29. [Sema][SVE] Properly match builtin ID when using aux target (details)
Commit 3a6a60f6c9c4a682de829635d7b9bb3bb64c2a7d by thakis
[lld/mac] Make a variable more local; no behavior change

The variable used to need the wider scope, but doesn't after the
reland. See LC_LINKER_OPTIONS-related discussion on
https://reviews.llvm.org/D104353 for background.
The file was modifiedlld/MachO/Driver.cpp
Commit 735ad67a4ce8d4a6c10f10d12f4282c796ea7ab7 by pengfei.wang
[clang] NFC: adjust indentation of statements with more than one lines

Hi,

I think it will be more beautiful to adjust indentation of statements with more than one lines.

In function TreeTransform<Derived>::TransformDependentScopeDeclRefExpr
the second line of statement
NestedNameSpecifierLoc QualifierLoc \newline = getDerived().TransformNestedNameSpecifierLoc(E->getQualifierLoc());
is no more indent than the first line

There is a similar case in function TreeTransform<Derived>::TransformUnresolvedMemberExpr

Also I use clang-format to fix above functions

Thanks alot

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D104145
The file was modifiedclang/lib/Sema/TreeTransform.h
Commit bb1dc876ebb8a2eef38d5183d00c2db1437f1c91 by mkazantsev
[LoopDeletion] Handle Phis with similar inputs from different blocks

This patch lifts the requirement to have the only incoming live block
for Phis. There can be multiple live blocks if the same value comes to
phi from all of them.

Differential Revision: https://reviews.llvm.org/D103959
Reviewed By: nikic, lebedev.ri
The file was modifiedllvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
The file was modifiedllvm/lib/Transforms/Scalar/LoopDeletion.cpp
Commit 657aa3a7631b991b25d0292ed73211f824938598 by esme.yi
[yaml2obj] Add support for writing the long symbol name.

Summary: This patch, as a follow-up of D95505, adds
support for writing the long symbol name by implementing
the StringTable. Only XCOFF32 is suppoted now.

Reviewed By: jhenderson, shchenz

Differential Revision: https://reviews.llvm.org/D103455
The file was modifiedllvm/lib/ObjectYAML/XCOFFEmitter.cpp
The file was addedllvm/test/tools/yaml2obj/XCOFF/long-symbol-name.yaml
Commit e37653da1399d846e02897680412139fdcde93ab by zeratul976
[clangd] Type hints for C++14 return type deduction

Differential Revision: https://reviews.llvm.org/D103789
The file was modifiedclang-tools-extra/clangd/InlayHints.cpp
The file was modifiedclang-tools-extra/clangd/unittests/InlayHintTests.cpp
Commit 3f2ff7cc8ca9a5ba28ac2b25e957a706c8f6491c by mkazantsev
[Test] Add some tests showing room for optimization exploiting undef and UB
The file was modifiedllvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
Commit 7a97cd9da787d560fee397eb598360349734711e by Pushpinder.Singh
[AMDGPU][Libomptarget] Remove redundant functions

There does not seem to be any use of these functions. They just
put the value to a local which is never used again.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D104512
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/system.cpp
Commit 80fd5fa5269ce102b3126d2de49970e3af6719d5 by mahesha.comp
[AMDGPU] Replace non-kernel function uses of LDS globals by pointers.

The main motivation behind pointer replacement of LDS use within non-kernel
functions is - to *avoid* subsequent LDS lowering pass from directly packing
LDS (assume large LDS) into a struct type which would otherwise cause allocating
huge memory for struct instance within every kernel.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D103225
The file was modifiedllvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-within-const-expr1.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/llc-pipeline.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-indirect-call-diamond-shape.ll
The file was addedllvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp
The file was modifiedllvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.h
The file was modifiedllvm/lib/Target/AMDGPU/CMakeLists.txt
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-call-selected_functions.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPU.h
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-within-phi-inst.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-indirect-call-selected_functions.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-within-const-expr2.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-call-diamond-shape.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-indirect-call-signature-match.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-multiple-lds.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-use-same-lds.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-not-reachable-lds.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-lds-offsets.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-global-scope-use.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-kernel-only-used-lds.ll
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-inline-asm-call.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
The file was addedllvm/test/CodeGen/AMDGPU/replace-lds-by-ptr-ignore-small-lds.ll
Commit b746a8db84ba28bcd54982655ff4e2762016bcda by llvmgnsyncbot
[gn build] Port 80fd5fa5269c
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn
Commit e04533d38a5e7524593001118054efb48dea2b34 by nicolas.vasilache
[mlir][Linalg] Introduce a BufferizationAliasInfo (6/n)

This revision adds a BufferizationAliasInfo which maintains and updates information about which tensors will alias once bufferized, which bufferized tensors are equivalent to others and how to handle clobbers.

Bufferization greedily tries to bufferize inplace by:

1. first trying to bufferize SubTensorInsertOp inplace, in reverse order (these are deemed the most expensives).
2. then trying to bufferize all non SubTensorOp / SubTensorInsertOp, in reverse order.
3. lastly trying to bufferize all SubTensorOp in reverse order.

Reverse order is a heuristic that seems to work nicely because structured tensor codegen very often proceeds by:

1. take a subset of a tensor
2. compute on that subset
3. insert the result subset into the full tensor and yield a new tensor.

BufferizationAliasInfo + equivalence sets + clobber analysis allows bufferizing nested
subtensor/compute/subtensor_insert sequences inplace to a certain extent.
To fully realize inplace bufferization, additional container-containee analysis will be necessary and is left for a subsequent commit.

Differential revision: https://reviews.llvm.org/D104110
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
The file was addedmlir/test/Dialect/Linalg/comprehensive-func-bufferize-analysis.mlir
The file was modifiedmlir/test/Dialect/Linalg/comprehensive-func-bufferize.mlir
Commit 11e9a72dfc83bd4d6ffecd4b84b57238ee87f1f4 by nicolas.vasilache
[mlir][Linalg] NFC - Drop unused variable definition.
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
Commit 208332de8abf126b6fb5590bea47cd12257bc064 by ruiling.song
[AMDGPU] Add Optimize VGPR LiveRange Pass.

This pass aims to optimize VGPR live-range in a typical divergent if-else
control flow. For example:

def(a)
if(cond)
  use(a)
  ... // A
else
  use(a)

As AMDGPU access vgpr with respect to active-mask, we can mark `a` as
dead in region A. For details, please refer to the comments in
implementation file.

The pass is enabled by default, the frontend can disable it through
"-amdgpu-opt-vgpr-liverange=false".

Differential Revision: https://reviews.llvm.org/D102212
The file was modifiedllvm/lib/Target/AMDGPU/CMakeLists.txt
The file was addedllvm/test/CodeGen/AMDGPU/vgpr-liverange.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPU.h
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/srem.i64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/urem.i64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/llc-pipeline.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/collapse-endcf.ll
The file was addedllvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp
The file was addedllvm/test/CodeGen/AMDGPU/vgpr-liverange-ir.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/sgpr-control-flow.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/skip-if-dead.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/bypass-div.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/sdiv.i64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/udiv.i64.ll
Commit 808ac8d5954f5d5cf160fcdd713fdf18cbda16dd by llvmgnsyncbot
[gn build] Port 208332de8abf
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Target/AMDGPU/BUILD.gn
Commit 225b960cfcc6091e0d51671f446cce7e00d41756 by springerm
[mlir][linalg] Support low padding in subtensor(pad_tensor) lowering

Differential Revision: https://reviews.llvm.org/D104591
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
The file was modifiedmlir/test/Dialect/Linalg/subtensor-of-padtensor.mlir
Commit 342bbb7832b69cc2adba9acaac0ed2b9bffbe896 by sjoerd.meijer
[FuncSpec] Don't specialise functions with NoDuplicate instructions.

getSpecializationCost was returning INT_MAX for a case when specialisation
shouldn't happen, but this wasn't properly checked if specialisation was
forced.

Differential Revision: https://reviews.llvm.org/D104461
The file was modifiedllvm/test/Transforms/FunctionSpecialization/function-specialization-nodup2.ll
The file was modifiedllvm/lib/Transforms/IPO/FunctionSpecialization.cpp
Commit c038845f58a84f03c88a03ab6a59014b3d6c180b by aqjune
[InstCombine] Fold icmp (select c,const,arg), null if icmp arg, null can be simplified

This patch folds icmp (select c,const,arg), null if icmp arg, null can be simplified.

Resolves llvm.org/pr48975.

Reviewed By: nikic, xbolva00

Differential Revision: https://reviews.llvm.org/D96663
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
The file was addedllvm/test/Transforms/InstCombine/assume-icmp-null-select.ll
Commit 00a88a81d2adcac1f39bc2581c54302aabb1d1dd by nikita.ppv
[Mem2Reg] Regenerate test checks (NFC)
The file was modifiedllvm/test/Transforms/Mem2Reg/pr37632-unreachable-list-of-stores.ll
Commit 80e0424b2ce9489bec73dbd3b920c4543a25feb1 by nikita.ppv
[Mem2Reg] Use poison for unreachable cases

Use poison instead of undef for cases dealing with unreachable
code. This still leaves the more interesting case of "load from
uninitialized memory" as undef.
The file was modifiedllvm/test/Transforms/Mem2Reg/pr37632-unreachable-list-of-stores.ll
The file was modifiedllvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
Commit 66f878cee91047162e7913cf9533e5313988175a by springerm
[mlir][NFC] Remove Standard dialect dependency on MemRef dialect

* Remove dependency: Standard --> MemRef
* Add dependencies: GPUToNVVMTransforms --> MemRef, Linalg --> MemRef, MemRef --> Tensor
* Note: The `subtensor_insert_propagate_dest_cast` test case in MemRef/canonicalize.mlir will be moved to Tensor/canonicalize.mlir in a subsequent commit, which moves over the remaining Tensor ops from the Standard dialect to the Tensor dialect.

Differential Revision: https://reviews.llvm.org/D104506
The file was modifiedmlir/lib/Dialect/SCF/Transforms/Bufferize.cpp
The file was modifiedmlir/include/mlir/Dialect/MemRef/IR/MemRefBase.td
The file was modifiedmlir/test/Dialect/Standard/canonicalize.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
The file was modifiedmlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp
The file was modifiedmlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp
The file was modifiedmlir/lib/Dialect/Shape/Transforms/Bufferize.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/IR/Ops.h
The file was modifiedmlir/include/mlir/Dialect/MemRef/IR/MemRef.h
The file was modifiedmlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Utils/Utils.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
The file was modifiedmlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/IR/Ops.td
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h
The file was modifiedmlir/test/Dialect/MemRef/canonicalize.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
Commit acefe0eaaf82c1d31a8d12e15751118eb40fe637 by nikita.ppv
[Mem2Reg] Regenerate test checks (NFC)
The file was modifiedllvm/test/Transforms/SROA/pr37267.ll
The file was modifiedllvm/test/Transforms/SROA/phi-and-select.ll
The file was modifiedllvm/test/Transforms/Mem2Reg/debug-alloca-vla-1.ll
The file was modifiedllvm/test/Transforms/Mem2Reg/pr24179.ll
The file was modifiedllvm/test/Transforms/Mem2Reg/undef-order.ll
The file was modifiedllvm/test/Transforms/Mem2Reg/debug-alloca-vla-2.ll
Commit bbd7424402c74b6a84c047657554ff7967da0e85 by sebastian.neubauer
[AMDGPU] Fix linking with shared libraries

AMDGPULDSUtils depends on llvm::CallGraph.
The file was modifiedllvm/lib/Target/AMDGPU/Utils/CMakeLists.txt
Commit 12ae3cb7ba5399b99c02e8a73c681192259e188f by david.spickett
[lldb] Assert that CommandResultObject error messages are not empty

The intention is now that AppendError/SetError/AppendRawError only
be called with some message to show. This enforces that.

For SetError with a Status and a fallback string first assert
that the Status is a failure Status. Then it calls SetError(StringRef)
which checks the message is valid. (which could be the fallback
or the Status')

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D104525
The file was modifiedlldb/source/Interpreter/CommandReturnObject.cpp
Commit 983972bfb0f9c55e85a1d352b55918a328f72380 by fraser
[VP][NFCI] Address various clang-tidy warnings

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D104288
The file was modifiedllvm/lib/IR/IntrinsicInst.cpp
The file was modifiedllvm/unittests/IR/VPIntrinsicTest.cpp
Commit 596989da6595e18c15ac18f6c3ff838cf048b068 by benny.kra
[mlir][Linalg] Silence warnings in Release builds. NFC.

mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:940:8: warning: unused variable 'opProducesRootRead' [-Wunused-variable]
  bool opProducesRootRead =
       ^
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:942:8: warning: unused variable 'opProducesRootWrite' [-Wunused-variable]
  bool opProducesRootWrite =
       ^
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:1498:11: warning: unused variable 'resultNumber' [-Wunused-variable]
  int64_t resultNumber = result.getResultNumber();
          ^
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:1497:11: warning: unused variable 'operandNumber' [-Wunused-variable]
  int64_t operandNumber = operand.getOperandNumber();
          ^
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp:267:20: warning: unused function 'getInPlace' [-Wunused-function]
static InPlaceSpec getInPlace(Value v) {
                   ^
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
Commit b650778dc4acbab8a5415e743604a2a0afabea3d by rupprecht
[NFC] Wrap entire assert-only block in LLVM_DEBUG
The file was modifiedllvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp
Commit 628e136738823c3f69f4d0fb406c78f017009d1e by vlad.vinogradov
[mlir][ODS] Fix copy ctor for generate Pass classes

Redirect the copy ctor to the actual class instead of
overwriting it with `TypeID` based ctor.

This allows the final Pass classes to have extra fields and logic for their copy.

Reviewed By: lattner

Differential Revision: https://reviews.llvm.org/D104302
The file was modifiedmlir/unittests/TableGen/CMakeLists.txt
The file was addedmlir/unittests/TableGen/PassGenTest.cpp
The file was modifiedmlir/tools/mlir-tblgen/PassGen.cpp
The file was addedmlir/unittests/TableGen/passes.td
The file was modifiedmlir/include/mlir/Pass/Pass.h
Commit 05bb969014d64611721cd30e4d890f626820ec76 by flo
[LoopIdiom] Add test case that involves adds with flags and zero exts.

Test coverage to ensure D104319 does not introduce a regression here.
The file was addedllvm/test/Transforms/LoopIdiom/X86/memset-size-compute.ll
Commit 7f20e6ae3229664f866149a4e0739a426b6fa463 by Raphael Isemann
[lldb][NFC] Remove redundant deleted constructors in HostInfoBase subclasses

HostInfoBase has a deleted dtor/ctor so there is no need to do the same for
all the classes inheriting from it.

Reviewed By: DavidSpickett, JDevlieghere

Differential Revision: https://reviews.llvm.org/D104221
The file was modifiedlldb/include/lldb/Host/macosx/HostInfoMacOSX.h
The file was modifiedlldb/include/lldb/Host/windows/HostInfoWindows.h
The file was modifiedlldb/include/lldb/Host/linux/HostInfoLinux.h
Commit 325b6707942dc295a0d7fc9bc23a8242d7a3824f by bradley.smith
[Sema][SVE] Properly match builtin ID when using aux target

Differential Revision: https://reviews.llvm.org/D104539
The file was addedclang/test/Sema/aarch64-sve-alias-attribute.c
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp