LLVM/project 6a7f6a0clang/lib/StaticAnalyzer/Checkers LifetimeModeling.h LifetimeModeling.cpp, clang/test/Analysis lifetime-bound.cpp

[analyzer] Implement BugReporterVisitor for UseAfterLifetimeEnd to trace lifetime source binding (#207052)

Currently the `UseAfterLifetimeEnd` checker can emit warnings, but those
warnings cannot clearly describe to which annotated parameter the return
value is actually bound. When multiple parameters are annotated, it is
unclear which one the return value is bound to. Using
`BugReporterVisitor` to trace back the nodes and emit a note that
explains where the lifetime of the annotated parameter (the source)
ended can be helpful for users.

***NOTE***: This PR is built on #205951. It should only be merged after
#205951 is merged.

Consider the following case: 

```cpp
#include <stddef.h>

class Arena {

    [39 lines not shown]
DeltaFile
+108-0clang/lib/StaticAnalyzer/Checkers/UseAfterLifetimeEnd.cpp
+51-38clang/test/Analysis/lifetime-bound.cpp
+5-0clang/lib/StaticAnalyzer/Checkers/LifetimeModeling.cpp
+3-0clang/lib/StaticAnalyzer/Checkers/LifetimeModeling.h
+167-384 files

LLVM/project 3db0dd7llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.h SPIRVNonSemanticDebugHandler.cpp, llvm/test/CodeGen/SPIRV/debug-info debug-function-definition.ll debug-function-definition-external-call.ll

Implement support for NSDI DebugFunctionDefinition. (#211853)

This PR depends on the DebugFunction PR:
https://github.com/llvm/llvm-project/pull/211760. This PR implements
support for
[DebugFunctionDefinition](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#DebugFunctionDefinition).

DebugFunctionDefinition must be emitted within the instruction sequence
of its corresponding OpFunction. The current implementation inserts
DebugFunctionDefinition immediately after the last OpVariable, if one
exists, or otherwise immediately after the first OpLabel. The goal is to
satisfy the following
[requirement](https://github.khronos.org/SPIRV-Registry/nonsemantic/NonSemantic.Shader.DebugInfo.html#_binary_form):

> DebugScope, DebugNoScope, DebugDeclare, DebugValue, DebugLine,
DebugNoLine, and DebugFunctionDefinition instructions may interleave
with instructions inside a function, but they must appear at valid
locations within a block as required by SPV_KHR_non_semantic_info. In
particular, they cannot appear before any OpPhi or function-level

    [7 lines not shown]
DeltaFile
+166-11llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+124-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-calls.ll
+88-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-call-before-alloca.ll
+53-25llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+56-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-external-call.ll
+55-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition.ll
+542-362 files not shown
+589-398 files

LLVM/project d2b28a8llvm/include/llvm/Analysis ConstantFolding.h TargetFolder.h, llvm/lib/Analysis InstructionSimplify.cpp ConstantFolding.cpp

[ConstFold] Fold fixed-vectors in constantFoldIntrinsic (#213625)

This exposes an underlying bug in wasm.dot-folding, which we fix. The
motivation for this patch is to enable folding of get.active.lane.mask
in VPlan in a follow-up.
DeltaFile
+9-4llvm/lib/Analysis/ConstantFolding.cpp
+9-0llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/dot.ll
+2-1llvm/include/llvm/Analysis/TargetFolder.h
+1-1llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+1-1llvm/lib/Analysis/InstructionSimplify.cpp
+1-0llvm/include/llvm/Analysis/ConstantFolding.h
+23-76 files

LLVM/project 2ef2ab6llvm/test/CodeGen/AArch64 complex-deinterleaving-multiuses.ll aarch64-interleaved-ld-combine.ll

[AArch64] Update tests with interleave intrinsics (#212312)
DeltaFile
+3,201-496llvm/test/CodeGen/AArch64/nontemporal-load-interleaved.ll
+3,057-480llvm/test/CodeGen/AArch64/nontemporal-store-interleaved.ll
+1,287-274llvm/test/CodeGen/AArch64/tbl-loops.ll
+1,259-235llvm/test/CodeGen/AArch64/vldn_shuffle.ll
+934-140llvm/test/CodeGen/AArch64/aarch64-interleaved-ld-combine.ll
+683-86llvm/test/CodeGen/AArch64/complex-deinterleaving-multiuses.ll
+10,421-1,7117 files not shown
+11,516-1,90013 files

LLVM/project 5ce177fmlir/lib/Dialect/MemRef/Transforms NormalizeMemRefs.cpp, mlir/lib/Transforms/Utils DialectConversion.cpp

Fix llvm-mlir-use-after-erase findings (#210733)

Fix the following warnings identified by the `llvm-mlir-use-after-erase`
check from https://github.com/llvm/llvm-project/pull/210727:

```cpp
mlir/lib/Transforms/Utils/DialectConversion.cpp:2700:33: warning: operation 'op' is used after it was erased [llvm-mlir-use-after-erase]
 2700 |           curState, std::string(op->getName().getStringRef()) + " folder");
      |                                 ^
mlir/lib/Transforms/Utils/DialectConversion.cpp:2685:12: note: operation erased here
 2685 |   rewriter.replaceOp(op, replacementValues);
      |            ^
mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp:440:29: warning: operation 'newOp' is used after it was erased [llvm-mlir-use-after-erase]
  440 |           Value newMemRef = newOp->getResult(resIndex);
      |                             ^
mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp:459:20: note: operation erased here 
  459 |             newOp->erase();
      |                    ^
mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp:440:29: note: the use happens in a later loop iteration than the erase

    [6 lines not shown]
DeltaFile
+14-0mlir/test/Dialect/MemRef/normalize-memrefs-ops.mlir
+1-2mlir/lib/Transforms/Utils/DialectConversion.cpp
+1-1mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp
+16-33 files

LLVM/project c301b99llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp, llvm/test/Transforms/InstCombine/AArch64 sve-intrinsic-opts-umin.ll

[AArch64][SVE] Fold nested boolean UMIN trees (#209234)

Fold redundant UMIN clamps in logical boolean reduction trees when all
operations use the same predicate.
DeltaFile
+144-0llvm/test/Transforms/InstCombine/AArch64/sve-intrinsic-opts-umin.ll
+28-0llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+172-02 files

LLVM/project bb76a64llvm/lib/Transforms/Vectorize LoopVectorizationPlanner.h VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize/RISCV tail-folding-complex-mask.ll

[VPlan] Append recipes created via builder to worklist
DeltaFile
+26-8llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+11-4llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+2-3llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-complex-mask.ll
+39-153 files

LLVM/project 5018bafllvm/test/Transforms/LoopVectorize/RISCV tail-folding-complex-mask.ll

Precommit test
DeltaFile
+163-0llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-complex-mask.ll
+163-01 files

LLVM/project cdad472llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp

Rename function.
DeltaFile
+4-3llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+4-31 files

LLVM/project ee20b2cllvm/test/CodeGen/SPIRV/debug-info debug-function-definition-external-call.ll debug-function-definition-call-before-alloca.ll

Improve tests.
DeltaFile
+124-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-calls.ll
+88-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-call-before-alloca.ll
+56-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-external-call.ll
+268-03 files

LLVM/project f07070allvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp

Fix rebase.
DeltaFile
+0-6llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+0-61 files

LLVM/project f2541dellvm/test/CodeGen/SPIRV/debug-info debug-function-definition.ll

Improve test.
DeltaFile
+19-4llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition.ll
+19-41 files

LLVM/project 0dad4a0llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp SPIRVAsmPrinter.cpp

Remove unused parameter.
DeltaFile
+1-2llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+1-1llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+1-1llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp
+3-43 files

LLVM/project becba34llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.h SPIRVNonSemanticDebugHandler.cpp

Change signature.
DeltaFile
+4-5llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+2-2llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+6-72 files

LLVM/project b94cdf1llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.h SPIRVNonSemanticDebugHandler.cpp

Remove CachedExtInstSetReg.
DeltaFile
+2-9llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+3-2llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+5-112 files

LLVM/project 0878f72llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.h

Keep original comment.
DeltaFile
+3-0llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+3-01 files

LLVM/project 322607cllvm/lib/Target/SPIRV SPIRVAsmPrinter.cpp SPIRVNonSemanticDebugHandler.h

[SPIRV] Drive DebugFunctionDefinition placement via begin/endInstruction

Replace the SPIRV-specific notifyMachineInstructionEmitted() callback with
DebugHandlerBase::beginInstruction()/endInstruction().
Keep notifyEntryLabelEmitted() for the synthesized entry OpLabel, which
has no MachineInstr.
DeltaFile
+22-14llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+8-12llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+2-5llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp
+32-313 files

LLVM/project fb8a7d5llvm/test/CodeGen/SPIRV/debug-info debug-function-definition.ll

Fix path check.
DeltaFile
+1-1llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition.ll
+1-11 files

LLVM/project ade3084llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp

Implement support for NSDI DebugFunction opcode.
DeltaFile
+6-0llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+6-01 files

LLVM/project a543d58llvm/lib/Target/SPIRV SPIRVAsmPrinter.cpp SPIRVNonSemanticDebugHandler.h, llvm/test/CodeGen/SPIRV/debug-info debug-function-definition-after-opvariable.ll debug-function-definition.ll

Implement support for NSDI DebugFunctionDefinition.
DeltaFile
+160-6llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+50-21llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+40-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition.ll
+36-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-after-opvariable.ll
+14-3llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp
+300-305 files

LLVM/project b16f12fllvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp

Simplify loops.
DeltaFile
+0-6llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+0-61 files

LLVM/project 0146212llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp

Implement support for NSDI DebugFunction opcode.
DeltaFile
+6-0llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+6-01 files

LLVM/project d901d0cllvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp

Simplify loops.
DeltaFile
+0-6llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+0-61 files

LLVM/project 94a2f29llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp

Implement support for NSDI DebugFunction opcode.
DeltaFile
+6-0llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+6-01 files

LLVM/project 0e87f69llvm/lib/Target/AArch64/GISel AArch64InstructionSelector.cpp, llvm/test/CodeGen/AArch64/GlobalISel select-constant.mir

[AArch64][GlobalISel] Select narrow GPR constants (#204322)

Select non-zero s8/s16 GPR constants as 32-bit MOV immediates during
instruction selection.

RegBankSelect already does this, but this gives instruction selection a
direct path instead of falling back which will help enable a simple fast
pure type-based RBS alternative.

Assisted-by: codex
DeltaFile
+19-2llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+1-0llvm/test/CodeGen/AArch64/GlobalISel/select-constant.mir
+20-22 files

LLVM/project 6b88c82lldb/test/API/tools/lldb-server TestGdbRemoteAuxvSupport.py, lldb/test/API/tools/lldb-server/commandline TestStubSetSID.py

[lldb] Convert all the tests to use require decorator (#213467)

This is a follow up to https://github.com/llvm/llvm-project/pull/212753
to convert all the tests to use the `@require` decorator.
DeltaFile
+8-8lldb/test/API/tools/lldb-server/vCont-threads/TestSignal.py
+5-5lldb/test/API/tools/lldb-server/TestGdbRemoteAuxvSupport.py
+4-4lldb/test/API/types/TestLongTypesExpr.py
+4-4lldb/test/API/types/TestLongTypes.py
+3-3lldb/test/API/types/TestIntegerTypeExpr.py
+3-3lldb/test/API/tools/lldb-server/commandline/TestStubSetSID.py
+27-2734 files not shown
+68-6840 files

LLVM/project 47f8126llvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.cpp

Rename function.
DeltaFile
+4-3llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+4-31 files

LLVM/project a14384dllvm/test/CodeGen/SPIRV/debug-info debug-function-definition-external-call.ll debug-function-definition-call-before-alloca.ll

Improve tests.
DeltaFile
+124-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-calls.ll
+88-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-call-before-alloca.ll
+56-0llvm/test/CodeGen/SPIRV/debug-info/debug-function-definition-external-call.ll
+268-03 files

LLVM/project 750b9d9lldb/source/Plugins/Process/gdb-remote GDBRemoteCommunicationServerLLGS.cpp, lldb/test/API/tools/lldb-server/registers-target-xml-reading TestGdbRemoteTargetXmlPacket.py

[lldb][lldb-server] Update the expected gdbserver's architecture (#210946)

gdbserver recognises 'x86_64' arch as 'i386:x86-64', this prevents gdb
(binary) from connecting to lldb-server since lldb-server reports
architecture as 'x86_64'. we already do something similar when
connecting a server to lldb.
This does not affect lldb -> lldb-server since we use qHostInfo to get
that information.
DeltaFile
+12-7lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+9-1lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py
+21-82 files

LLVM/project 1674a1cruntimes/cmake config-Fortran.cmake

[runtimes][cmake] Probe Fortran intrinsic modules for the target triple (#211137)

Fixes #211134.

`check_fortran_builtins_available()` probes for Fortran intrinsic
modules without passing the target triple, in both branches: the
`-print-file-name=iso_c_binding.mod` query runs the driver with no
`--target`, and the `check_fortran_source_compiles()` fallback uses
`try_compile()`, which does not inherit `CMAKE_Fortran_COMPILER_TARGET`.

Flang's intrinsic modules are built per-target by flang-rt. When a
runtime is configured for a GPU target without flang-rt in its runtime
list, both probes test the host and succeed, so
`RUNTIMES_FORTRAN_MODULES` is enabled for a target that cannot support
it. `LIBOMP_FORTRAN_MODULES` inherits that and the failure is deferred
to a cascade of BIND(C) diagnostics compiling `omp_lib.F90`, all
stemming from one missing-module error.

Pass the triple to both probes so the existing graceful-degradation path

    [36 lines not shown]
DeltaFile
+18-2runtimes/cmake/config-Fortran.cmake
+18-21 files