LLVM/project fd65b3ellvm/include/llvm/CodeGen SwiftErrorValueTracking.h, llvm/lib/CodeGen SwiftErrorValueTracking.cpp

[GlobalISel] Fix UMR in `SwiftErrorValueTracking` (#190273)

Fix issue reported on
https://github.com/llvm/llvm-project/pull/188296#issuecomment-4179103756

`SwiftErrorValueTracking` holds per-function state used by
`IRTranslator`.

On targets where `TargetLowering::supportSwiftError()` is false, (e.g.
wasm) `SwiftErrorValueTracking::setFunction()` exits early.
Historically, that early return happened before clearing per-function
containers, and pointer members (including `SwiftErrorArg`) had no
in-class initialization.

The bad case is a function with a swifterror argument on such a target:
`IRTranslator` uses `SwiftError.getFunctionArg()` without checking
`supportSwiftError()` and this could read an uninitialized
`SwiftErrorArg` value. (SelectionDAG gates the `getFunctionArg` usages
behind `supportSwiftError()`, so it's specific to GlobalISel)

    [10 lines not shown]
DeltaFile
+5-5llvm/include/llvm/CodeGen/SwiftErrorValueTracking.h
+3-3llvm/lib/CodeGen/SwiftErrorValueTracking.cpp
+1-1llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+9-93 files

LLVM/project d8d2e33lldb/test/Shell/Commands command-dil-diagnostics.test

[lldb] Make command-dil-diagnostics.test UNSUPPORTED on Windows (#190341)

The test from #187680 passes on some Windows buildbots, but fails on
others.
DeltaFile
+1-1lldb/test/Shell/Commands/command-dil-diagnostics.test
+1-11 files

LLVM/project 5674755llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp

[DAG] visitMUL - cleanup pattern matchers to use m_Shl and (commutative) m_Mul directly (#190339)

Based on feedback on #190215
DeltaFile
+12-18llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+12-181 files

LLVM/project c963092llvm/lib/Transforms/Vectorize VPlanRecipes.cpp, llvm/unittests/Transforms/Vectorize VPlanTest.cpp

[VPlan] Mark VPCanonicalIVPHI as not reading memory (NFCI). (#190338)

The canonical IV does not access any memory. Mark accordingly. This
should be NFC end-to-end.

PR: https://github.com/llvm/llvm-project/pull/190338
DeltaFile
+7-0llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
+1-0llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+8-02 files

LLVM/project b8cf4e3clang/lib/Driver ToolChain.cpp CMakeLists.txt, clang/lib/Driver/ToolChains/Arch AMDGPU.cpp AMDGPU.h

clang/AMDGPU: Refactor triple adjustments

Factor this similar to the ARM case for future
expansion. The difference being -mcpu is treated as
an alias for -mcpu instead of something separately
useful.

I don't understand this mutation of the triple into
spirv64. The only test where this appears to matter
does not use -mcpu. Previously this would only match
for -mcpu, but this would change the behavior to prefer
-march before falling back to -mcpu.
DeltaFile
+38-0clang/lib/Driver/ToolChains/Arch/AMDGPU.cpp
+32-0clang/lib/Driver/ToolChains/Arch/AMDGPU.h
+2-2clang/lib/Driver/ToolChain.cpp
+1-0clang/lib/Driver/CMakeLists.txt
+73-24 files

LLVM/project 0a3fdd3clang/include/clang/CIR/Dialect/IR CIRTypes.td, clang/lib/CIR/CodeGen CIRGenCall.cpp CIRGenTypes.h

[CIR] Handle vtable-lowering-with-incomplete types (#190216)

The NYI diagnostic in getFunctionTypeForVTable showed up a few times in
testing, so this patch is attempting to fix that up.

The reproducer here is a function type for a vtable that has an
incomplete type in it(return or parameter). Classic codegen chooses to
represent this as an opaque type.

This patch instead removes the special v-table handling here, so that we
can instead just represent the types as incomplete record types.

At the moment, this patch ends up lowering incomplete types as 'empty'
types in LLVM-IR, which we may find we need to modify in the future,
however at the moment, it seems to work.

This patch ALSO changes the definition of RecordType::isSized to only be
true for complete types, which prevents a number of other things from
attempting to add attributes/check the size of the type/etc, but those
are irrelevant for the purposes of vtable emission.
DeltaFile
+66-0clang/test/CIR/CodeGen/vtable-nyi-nonconvertible-functype.cpp
+0-10clang/lib/CIR/CodeGen/CIRGenCall.cpp
+0-5clang/lib/CIR/CodeGen/CIRGenTypes.h
+2-2clang/lib/CIR/CodeGen/CIRGenVTables.cpp
+4-0clang/include/clang/CIR/Dialect/IR/CIRTypes.td
+72-175 files

LLVM/project 2c734b3clang/lib/CIR/CodeGen CIRGenModule.cpp, clang/test/CIR/CodeGen export-decl.cppm

[CIR] Implement top level 'ExportDecl' emission (#190286)

This is a pretty simple one, its just a type of decl-context. The actual
exporty-ness is handled on a per-declaration basis.

This patch just makes sure we emit them, as I suspect this will reveal
quite a bit more issues in module code I suspect.
DeltaFile
+27-0clang/test/CIR/CodeGen/export-decl.cppm
+3-0clang/lib/CIR/CodeGen/CIRGenModule.cpp
+30-02 files

LLVM/project cf553calldb/source/Commands CommandObjectFrame.cpp, lldb/source/Target StackFrame.cpp

Revert "[lldb] Fix DIL error diagnostics output (#187680)"

This reverts commit e24936b7ad5c6b1fdcc35d98c682fa5bd745e65b.
DeltaFile
+0-22lldb/test/Shell/Commands/command-dil-diagnostics.test
+4-18lldb/source/ValueObject/DILParser.cpp
+2-15lldb/source/Commands/CommandObjectFrame.cpp
+3-3lldb/source/Target/StackFrame.cpp
+0-1lldb/test/Shell/Commands/Inputs/main.c
+9-595 files

LLVM/project 0932472clang/lib/CIR/CodeGen CIRGenStmtOpenMP.cpp CIRGenStmt.cpp

[CIR][NFC] Add NYI for OMPSplitDirective stmt (#190329)

Fix the warning of missing OMPSplitDirective statement in the emitStmt
switch
DeltaFile
+5-0clang/lib/CIR/CodeGen/CIRGenStmtOpenMP.cpp
+2-0clang/lib/CIR/CodeGen/CIRGenStmt.cpp
+1-0clang/lib/CIR/CodeGen/CIRGenFunction.h
+8-03 files

LLVM/project b9924c7clang/lib/Lex Preprocessor.cpp, clang/test/Preprocessor dump-tokens.cpp

[clang] Make -dump-tokens option align tokens (#164894)

When using `-Xclang -dump-tokens`, the lexer dump output is currently
difficult to read because the data are misaligned. The existing
implementation simply separates the token name, spelling, flags, and
location using `'\t'`, which results in inconsistent spacing.

For example, the current output looks like this on provided in this
patch example **(BEFORE THIS PR)**:

<img width="2936" height="632" alt="image"
src="https://github.com/user-attachments/assets/ad893958-6d57-4a76-8838-7fc56e37e6a7"
/>

# Changes

This small PR improves the readability of the token dump by:

+ Adding padding after the token name and after the spelling (the

    [9 lines not shown]
DeltaFile
+51-10clang/lib/Lex/Preprocessor.cpp
+37-0clang/test/Preprocessor/dump-tokens.cpp
+88-102 files

LLVM/project a44c158llvm/lib/Target/AMDGPU AMDGPUISelLowering.cpp AMDGPUISelLowering.h, llvm/test/CodeGen/AMDGPU atomic_optimizations_global_pointer.ll amdgpu-simplify-demanded-bits-readfirstlane.ll

[AMDGPU][CodeGen] Implement SimplifyDemandedBitsForTargetNode for readfirstlane. (#190009)

Propagate demanded bits through readfirstlane intrinsic in
AMDGPUISelLowering with SimplifyDemandedBitsForTargetNode
implementation.

This allows upstream zero/sign extensions to be eliminated when only a
subset of bits is used after the intrinsic.

Partially addresses #128390.
DeltaFile
+104-172llvm/test/CodeGen/AMDGPU/atomic_optimizations_global_pointer.ll
+60-0llvm/test/CodeGen/AMDGPU/amdgpu-simplify-demanded-bits-readfirstlane.ll
+25-0llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+4-14llvm/test/CodeGen/AMDGPU/fix-sgpr-copies-wwm.ll
+8-0llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
+2-5llvm/test/CodeGen/AMDGPU/always-uniform.ll
+203-1916 files

LLVM/project 00aede8clang/include/clang/AST OpenMPClause.h, clang/lib/Sema SemaOpenMP.cpp

Revert "[Clang][OpenMP] Implement Loop splitting `#pragma omp split` directive " (#190335)

Reverts llvm/llvm-project#183261

15 new lit tests failing in openmp
DeltaFile
+0-1,986clang/test/OpenMP/split_codegen.cpp
+0-270clang/lib/Sema/SemaOpenMP.cpp
+0-139openmp/runtime/test/transform/split/iterfor.cpp
+0-123clang/test/OpenMP/split_counts_verify.c
+0-101clang/include/clang/AST/OpenMPClause.h
+0-99clang/test/OpenMP/split_messages.cpp
+0-2,71874 files not shown
+11-4,20080 files

LLVM/project bc695ballvm/lib/Transforms/Vectorize SLPVectorizer.cpp

Fix formatting

Created using spr 1.3.7
DeltaFile
+2-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+2-11 files

LLVM/project bae0a95llvm/test/CodeGen/AMDGPU memory-legalizer-private-workgroup.ll memory-legalizer-private-wavefront.ll

Rebase, small improvement

Created using spr 1.3.7
DeltaFile
+8,544-1,366llvm/test/CodeGen/AMDGPU/memory-legalizer-private-workgroup.ll
+8,544-1,366llvm/test/CodeGen/AMDGPU/memory-legalizer-private-wavefront.ll
+8,544-1,366llvm/test/CodeGen/AMDGPU/memory-legalizer-private-singlethread.ll
+8,449-1,355llvm/test/CodeGen/AMDGPU/memory-legalizer-private-agent.ll
+8,449-1,355llvm/test/CodeGen/AMDGPU/memory-legalizer-private-cluster.ll
+8,069-1,315llvm/test/CodeGen/AMDGPU/memory-legalizer-private-system.ll
+50,599-8,1232,149 files not shown
+310,123-86,6592,155 files

LLVM/project 15ed4f6llvm/lib/CodeGen/SelectionDAG SelectionDAG.cpp, llvm/test/CodeGen/X86 known-pow2.ll

[DAG] isKnownToBeAPowerOfTwo - add missing DemandedElts handling to ISD::TRUNCATE and hidden m_Neg pattern (#190190)

Use MaskedVectorIsZero to match X & -X pattern when only DemandedElts
match the negation pattern

Fixes #181654 (properly)
DeltaFile
+8-6llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+3-4llvm/test/CodeGen/X86/known-pow2.ll
+11-102 files

LLVM/project 66280d3clang/include/clang/AST OpenMPClause.h, clang/lib/Sema SemaOpenMP.cpp

Revert "[Clang][OpenMP] Implement Loop splitting `#pragma omp split` directiv…"

This reverts commit 1972cf64fd18227bd8c3cc94ad96164cae9a163a.
DeltaFile
+0-1,986clang/test/OpenMP/split_codegen.cpp
+0-270clang/lib/Sema/SemaOpenMP.cpp
+0-139openmp/runtime/test/transform/split/iterfor.cpp
+0-123clang/test/OpenMP/split_counts_verify.c
+0-101clang/include/clang/AST/OpenMPClause.h
+0-99clang/test/OpenMP/split_messages.cpp
+0-2,71874 files not shown
+11-4,20080 files

LLVM/project c717890llvm/test/CodeGen/AMDGPU amdgpu-sw-lower-lds-multi-static-dynamic-indirect-access-asan.ll amdgpu-sw-lower-lds-static-dynamic-indirect-access-asan.ll

[AMDGPU] Use ASan callback functions instead of inline checks in SW lower LDS pass
DeltaFile
+31-157llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-multi-static-dynamic-indirect-access-asan.ll
+8-119llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-dynamic-indirect-access-asan.ll
+6-117llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-dynamic-indirect-access-asan.ll
+3-118llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-test-atomicrmw-asan.ll
+7-98llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access-asan.ll
+4-89llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-dynamic-lds-test-asan.ll
+59-6987 files not shown
+113-96913 files

LLVM/project f1d1671lldb/source/Plugins/Disassembler/LLVMC DisassemblerLLVMC.cpp

[lldb] Return 0 instead of false from a function returning size_t (NFC) (#190334)
DeltaFile
+1-1lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+1-11 files

LLVM/project e24936blldb/source/Commands CommandObjectFrame.cpp, lldb/source/Target StackFrame.cpp

[lldb] Fix DIL error diagnostics output (#187680)

* Correctly return the result when used from the console, so that
`DiagnosticsRendering` could use it to output the error.
* Add location pointer to `DILDiagnosticError` internal formatting to
show diagnostics when called from the API.
DeltaFile
+18-4lldb/source/ValueObject/DILParser.cpp
+22-0lldb/test/Shell/Commands/command-dil-diagnostics.test
+15-2lldb/source/Commands/CommandObjectFrame.cpp
+3-3lldb/source/Target/StackFrame.cpp
+1-0lldb/test/Shell/Commands/Inputs/main.c
+59-95 files

LLVM/project 03b9c72llvm/lib/Target/SPIRV SPIRVGlobalRegistry.cpp, llvm/test/CodeGen/SPIRV/hlsl-intrinsics builtin-var-dominance.ll

[SPIR-V] Emit builtin variable OpVariable into entry block (#189958)
DeltaFile
+48-0llvm/test/CodeGen/SPIRV/hlsl-intrinsics/builtin-var-dominance.ll
+33-0llvm/test/CodeGen/SPIRV/transcoding/builtin-var-dominance.ll
+8-1llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+3-4llvm/test/CodeGen/SPIRV/transcoding/OpGroupAsyncCopy.ll
+92-54 files

LLVM/project c2ec012mlir/lib/Dialect/Linalg/Transforms TilingInterfaceImpl.cpp, mlir/test/Dialect/Linalg transform-tile-reduction.mlir

[mlir][linalg] Fix crash in tile_reduction when output map has constant exprs (#189166)

`generateInitialTensorForPartialReduction` and the `getInitSliceInfo*`
helpers unconditionally cast every result expression of the partial
result AffineMap to `AffineDimExpr`. When the original output indexing
map contains a constant (e.g. `affine_map<(d0,d1,d2)->(d0,0,d2)>`), the
constant expression propagates into the partial map and the cast
triggers an assertion.


Fixes #173025

Assisted-by: Claude Code
DeltaFile
+301-0mlir/test/Dialect/Linalg/transform-tile-reduction.mlir
+62-18mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
+363-182 files

LLVM/project 273e8d8llvm/include/llvm/IR DiagnosticInfo.h, llvm/lib/Target/AMDGPU AMDGPUAsmPrinter.cpp

DiagnosticInfo: Fix missing LLVM_LIFETIME_BOUND on Twine arguments (#190331)

Fix use after free errors in DiagnosticInfoResourceLimit uses.
DeltaFile
+16-22llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+2-1llvm/include/llvm/IR/DiagnosticInfo.h
+18-232 files

LLVM/project 73bcfb6mlir/lib/Dialect/Affine/Transforms AffineLoopInvariantCodeMotion.cpp, mlir/test/Dialect/Affine affine-loop-invariant-code-motion.mlir

[mlir][Affine] Fix LICM incorrectly hoisting stores from zero-trip-count loops (#189165)

The affine-loop-invariant-code-motion pass was hoisting side-effectful
operations (e.g. affine.store) out of loops whose trip count is
statically known to be zero. This caused stores to execute
unconditionally even though the loop body should never run, producing
incorrect results.

The fix skips hoisting of non-memory-effect-free ops when
getConstantTripCount returns 0. Pure/side-effect-free ops are still
eligible for hoisting because they cannot change observable program
state.

Fixes #128273

Assisted-by: Claude Code
DeltaFile
+74-2mlir/test/Dialect/Affine/affine-loop-invariant-code-motion.mlir
+12-1mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
+86-32 files

LLVM/project e96ec28llvm/test/CodeGen/AMDGPU amdgpu-sw-lower-lds-multi-static-dynamic-indirect-access-asan.ll amdgpu-sw-lower-lds-static-dynamic-indirect-access-asan.ll

[AMDGPU] Use ASan callback functions instead of inline checks in SW lower LDS pass
DeltaFile
+30-157llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-multi-static-dynamic-indirect-access-asan.ll
+8-119llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-dynamic-indirect-access-asan.ll
+6-117llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-dynamic-indirect-access-asan.ll
+3-118llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-lds-test-atomicrmw-asan.ll
+7-98llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-indirect-access-asan.ll
+4-89llvm/test/CodeGen/AMDGPU/amdgpu-sw-lower-lds-static-dynamic-lds-test-asan.ll
+58-6987 files not shown
+113-96913 files

LLVM/project 9e516f5llvm/include/llvm/CodeGen MachinePipeliner.h, llvm/lib/CodeGen MachinePipeliner.cpp

[MachinePipeliner] Remove isLoopCarriedDep and use DDG (#174394)

This patch completely removes `isLoopCarriedDep`, which was used
previously to identify loop-carried dependencies in the DAG. Now that we
have the DDG representation, this special handling is no longer
necessary. Simply replacing its usage with the DDG causes several tests
to fail, since cycle detection takes some of the validation-only edges
in the DDG into account. To address this, this patch introduces extra
edges in the DDG, which are used only for cycle detection and not for
other parts of the pass (e.g., scheduling). The extra edges are
determined to preserve the existing behavior of the pass as closely as
possible, which makes the predicates for adding them somewhat complex.

Split off from #135148, and the final patch in the series for #135148
DeltaFile
+0-335llvm/test/CodeGen/AArch64/sms-instruction-scheduled-at-correct-cycle.mir
+42-50llvm/lib/CodeGen/MachinePipeliner.cpp
+15-9llvm/include/llvm/CodeGen/MachinePipeliner.h
+57-3943 files

LLVM/project 746439dllvm/include/llvm/IR DiagnosticInfo.h, llvm/lib/Target/AMDGPU AMDGPUAsmPrinter.cpp

DiagnosticInfo: Fix missing LLVM_LIFETIME_BOUND on Twine arguments

Fix use after free errors in DiagnosticInfoResourceLimit uses.
DeltaFile
+16-22llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+2-1llvm/include/llvm/IR/DiagnosticInfo.h
+18-232 files

LLVM/project 94e3fe7offload/test/libc rpc_callback.cpp

Merge branch 'main' into users/kasuga-fj/pipeliner-remove-isloopcarrieddep
DeltaFile
+1-1offload/test/libc/rpc_callback.cpp
+1-11 files

LLVM/project 3bc3e30llvm/test/CodeGen/AArch64 sms-instruction-scheduled-at-correct-cycle.mir

remove useless test
DeltaFile
+0-338llvm/test/CodeGen/AArch64/sms-instruction-scheduled-at-correct-cycle.mir
+0-3381 files

LLVM/project a2d3783offload/test/libc rpc_callback.cpp

[offload][libc] Adapt test to changes in #190239 (#190330)
DeltaFile
+1-1offload/test/libc/rpc_callback.cpp
+1-11 files

LLVM/project 87439fdllvm/include/llvm/CodeGen MachinePipeliner.h, llvm/lib/CodeGen MachinePipeliner.cpp

[MachinePipeliner] Remove isLoopCarriedDep and use DDG
DeltaFile
+42-50llvm/lib/CodeGen/MachinePipeliner.cpp
+15-9llvm/include/llvm/CodeGen/MachinePipeliner.h
+3-0llvm/test/CodeGen/AArch64/sms-instruction-scheduled-at-correct-cycle.mir
+60-593 files