LLVM/project 424c5a5 — mlir/include/mlir/Dialect/Linalg/TransformOps LinalgTransformOps.td, mlir/lib/Dialect/Linalg/TransformOps LinalgTransformOps.cpp

[mlir][transform] Fuse selected producers in reverse topological order (#241779)

`transform.structured.fuse_into_containing_op` can leave a shared
producer partially unfused when it is processed before one of its
selected consumers.

For a dependency such as `P -> R -> Y` with an additional `P -> Y` edge,
P may be removed from the pending set before fusing R introduces another
use of P. In the standard Softmax decomposition, this leaves both
full-tensor and tiled exponential computations, even after
canonicalization and CSE.

Process selected producers in reverse topological order so that consumer
fusion exposes all relevant producer uses before the producer is
retired. Also diagnose parentless producers before sorting.

Regression tests cover Softmax with both handle orders, skip
connections, multi-result producers, distinct tiles, and invalid
top-level producers.

    [5 lines not shown]
DeltaFile
+266-0mlir/test/Dialect/Linalg/transform-op-fuse-into-containing-order.mlir
+19-8mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
+5-5mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
+290-133 files

LLVM/project c55d341 — mlir/include/mlir/Transforms LoopInvariantCodeMotionUtils.h, mlir/lib/Dialect/Affine/Transforms AffineLoopInvariantCodeMotion.cpp

[mlir] Hoist invariant ops out of nested regions in LICM (#227145)

LICM only looked at ops directly in the loop body, so an invariant op
inside an `scf.if` or `affine.if` that stays in the loop was never
hoisted. The shared LICM utility now also looks into control-flow
regions nested in the loop body and hoists pure ops whose operands are
defined outside the loop.

Fixes #226878
Fixes #215458
Fixes #215492

Used Claude to write tests
DeltaFile
+240-13mlir/test/Transforms/loop-invariant-code-motion.mlir
+148-19mlir/test/Dialect/Affine/affine-loop-invariant-code-motion.mlir
+48-1mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
+22-1mlir/include/mlir/Transforms/LoopInvariantCodeMotionUtils.h
+6-10mlir/test/Dialect/SparseTensor/sparse_kernels_to_iterator.mlir
+4-0mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
+468-446 files

LLVM/project a2f1d1a — llvm/docs LangRef.md, llvm/include/llvm/Transforms/Vectorize LoopVectorizationLegality.h

[LoopVectorize] Add llvm.loop.vectorize.fp_unsafe.{enable,disable} metadata (#219167)

Add a new per-loop metadata key llvm.loop.vectorize.fp_unsafe to
explicitly control whether the Loop Vectorizer may apply floating-point
transforms that change the computed result:

!{!"llvm.loop.vectorize.fp_unsafe.enable"}   ; allowed
!{!"llvm.loop.vectorize.fp_unsafe.disable"}  ; suppressed

The hint governs both places where this is currently implied by
vectorize.enable.

- allowReordering() - reassociation of FP reductions
- isPotentiallyUnsafe() - vectorization on targets whose vector FP
semantics differ from their scalar semantics
When absent, both retain their existing behaviour: vectorize.enable or
an explicit vector width > 1 grants the relaxation. When present, the
hint takes precedence over that default.


    [2 lines not shown]
DeltaFile
+138-0llvm/test/Transforms/LoopVectorize/ARM/fp-unsafe-metadata.ll
+92-0llvm/test/Transforms/LoopVectorize/fp-unsafe-metadata.ll
+20-6llvm/include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
+18-0llvm/docs/LangRef.md
+14-3llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+282-95 files

LLVM/project 576bb36 — lldb/source/ValueObject DILEval.cpp

[lldb] Retrieve TypeSystem from CompilerType in DIL
DeltaFile
+32-16lldb/source/ValueObject/DILEval.cpp
+32-161 files

LLVM/project bbe6909 — libcxx/include/__memory allocator_arg_t.h

[libc++] Simplify __uses_alloc_ctor (#244548)

This avoids some class template instantiations, making the code faster
to compile.
DeltaFile
+5-7libcxx/include/__memory/allocator_arg_t.h
+5-71 files

LLVM/project 350c60f — llvm/test/CodeGen/SystemZ zos-hlasm-dc-xl.ll

Update last test
DeltaFile
+6-3llvm/test/CodeGen/SystemZ/zos-hlasm-dc-xl.ll
+6-31 files

LLVM/project 4ec2ddb — llvm/test/MC/RISCV xqcicm-invalid.s xqcibi-invalid.s, llvm/test/MC/RISCV/rvv vsetvl.s

[nspr] initial commit
DeltaFile
+151-154llvm/test/MC/RISCV/rv32i-invalid.s
+134-130llvm/test/MC/RISCV/xqcicli-invalid.s
+115-127llvm/test/MC/RISCV/xqcia-invalid.s
+110-100llvm/test/MC/RISCV/xqcibi-invalid.s
+59-112llvm/test/MC/RISCV/rvv/vsetvl.s
+79-88llvm/test/MC/RISCV/xqcicm-invalid.s
+648-71133 files not shown
+1,585-1,72839 files

LLVM/project 0bae749 — llvm/test/MC/RISCV xaifet-amo-valid.s xqcibm-invalid.s, llvm/test/MC/RISCV/corev XCVsimd.s XCVsimd-invalid.s

[nspr] initial commit
DeltaFile
+1,356-2,712llvm/test/MC/RISCV/corev/XCVsimd-invalid.s
+881-1,762llvm/test/MC/RISCV/corev/XCVsimd.s
+514-1,028llvm/test/MC/RISCV/rvv/zvlsseg.s
+303-608llvm/test/MC/RISCV/zfa-valid.s
+280-310llvm/test/MC/RISCV/xqcibm-invalid.s
+182-364llvm/test/MC/RISCV/xaifet-amo-valid.s
+3,516-6,784258 files not shown
+8,492-14,763264 files

LLVM/project 3e25256 — llvm/utils convert_mc_test_to_verify.py

[nspr] update
DeltaFile
+15-2llvm/utils/convert_mc_test_to_verify.py
+15-21 files

LLVM/project 1717e15 — llvm/include/llvm/Support SourceMgrDiagnosticVerifier.h, llvm/lib/Support SourceMgrDiagnosticVerifier.cpp

[nspr] initial commit
DeltaFile
+30-18llvm/lib/Support/SourceMgrDiagnosticVerifier.cpp
+35-0llvm/test/tools/llvm-mc/verify/basic.s
+8-8mlir/test/Dialect/OpenMP/memory-effects.mlir
+2-8mlir/test/Dialect/Transform/multi-arg-top-level-values.mlir
+5-5mlir/test/Dialect/Transform/test-interpreter.mlir
+5-3llvm/include/llvm/Support/SourceMgrDiagnosticVerifier.h
+85-4216 files not shown
+113-6522 files

LLVM/project 9d375f9 — llvm/lib/Target/AMDGPU SIISelLowering.h SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.cluster.workgroup.max.id.ll llvm.amdgcn.cluster.workgroup.id.ll

[AMDGPU] Read TTMP6 only if clusters are enabled

The hardware only initializes TTMP6 when clusters are enabled, but
`llvm.amdgcn.cluster.workgroup.{id,max.id}.{x,y,z}` and
`llvm.amdgcn.cluster.workgroup.max.flat.id` read it without a check, so they
could potentially return stale values without clusters. The programming model
treats a launch without clusters as an implicit 1x1x1 cluster, so all of these
values are 0.

Fixes LCOMPILER-3241.

This PR was assisted by AI but I reviewed all the changes.
DeltaFile
+592-3llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cluster.workgroup.max.flat.id.ll
+503-18llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cluster.workgroup.id.ll
+446-18llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cluster.workgroup.max.id.ll
+58-41llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+70-29llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+4-0llvm/lib/Target/AMDGPU/SIISelLowering.h
+1,673-1091 files not shown
+1,676-1097 files

LLVM/project c7d7fe4 — llvm/test/CodeGen/X86 sad.ll

[X86] sad.ll - add #244529 test coverage (#244595)
DeltaFile
+26-3llvm/test/CodeGen/X86/sad.ll
+26-31 files

LLVM/project 6666121 — llvm/include/llvm/CodeGen LiveStacks.h, llvm/lib/CodeGen RegAllocGreedy.cpp LiveStacks.cpp

[CodeGen] Repair LiveStacks before compaction

Spill slot intervals survive between greedy runs, and their
boundaries can sit on instructions erased in between. Compaction
unlinks those entries, so the boundaries stop following renumbering
and overlapping slots can look disjoint. StackSlotColoring then
merges them, and one spill clobbers the other.

Move such boundaries onto the preceding instruction first.
DeltaFile
+158-0llvm/test/CodeGen/RISCV/rvv/greedy-compact-slot-indexes-spill-slot.ll
+121-0llvm/unittests/CodeGen/SlotIndexesTest.cpp
+22-0llvm/lib/CodeGen/LiveStacks.cpp
+3-0llvm/include/llvm/CodeGen/LiveStacks.h
+1-0llvm/lib/CodeGen/RegAllocGreedy.cpp
+305-05 files

LLVM/project 0b8418a — flang/lib/Lower PFTBuilder.cpp, flang/test/Lower loops.f90 do_loop_unstructured.f90

[flang] Keep do concurrent structured when its branching stays in the body

A DO loop whose raw branching is confined to its body keeps its structured
form, with only the body folded into an scf.execute_region. Only increment
loops qualified. A do concurrent header puts no control flow in the body
either: its indices are always integer and its mask is a test inside the
innermost loop. So a do concurrent qualifies under the same body checks.

This lets a do concurrent with, for example, a SELECT CASE in its body lower
inside an OpenACC kernels region instead of hitting the "unstructured do loop
in acc kernels" TODO.
DeltaFile
+214-0flang/test/Lower/do-concurrent-unstructured-internals.f90
+55-27flang/test/Lower/do_concurrent.f90
+65-0flang/test/Lower/OpenACC/acc-directive-loop-bounds.f90
+24-18flang/lib/Lower/PFTBuilder.cpp
+10-11flang/test/Lower/do_loop_unstructured.f90
+6-2flang/test/Lower/loops.f90
+374-586 files

LLVM/project 24c0af4 — flang/lib/Lower Bridge.cpp OpenACC.cpp, flang/test/Lower/OpenACC acc-loop-seq-do-while.f90

[flang][OpenACC] Fix lowering crash on DO WHILE loop constructs (#243885)

A loop construct associated with a DO WHILE crashed lowering: reading
the
DO WHILE's loop control as bounds aborted, both when the DO WHILE is
lowered
unstructured and, with -lower-do-while-to-scf-while, when it is lowered
structurally. A DO WHILE has no bounds and no induction variable, so
lower
the construct to an acc.loop without bounds that holds the whole DO
WHILE,
as for an unstructured loop, with nothing to privatize.


PR stack:
- https://github.com/llvm/llvm-project/pull/243884
- https://github.com/llvm/llvm-project/pull/243885 ⬅️
- https://github.com/llvm/llvm-project/pull/244176
DeltaFile
+227-0flang/test/Lower/OpenACC/acc-loop-seq-do-while.f90
+13-6flang/lib/Lower/OpenACC.cpp
+10-2flang/lib/Lower/Bridge.cpp
+250-83 files

LLVM/project 7fd67be — lldb/include/lldb/Target Target.h, lldb/source/API SBTarget.cpp

[lldb] Add support for DIL in Target and `target var`
DeltaFile
+54-29lldb/source/Commands/CommandObjectTarget.cpp
+60-0lldb/test/API/commands/target/basic/TestTargetCommand.py
+46-0lldb/source/API/SBTarget.cpp
+21-19lldb/source/ValueObject/DILEval.cpp
+40-0lldb/source/Target/Target.cpp
+35-0lldb/include/lldb/Target/Target.h
+256-486 files not shown
+304-5412 files

LLVM/project f251559 — llvm/lib/IR IRBuilder.cpp, llvm/test/CodeGen/AMDGPU lower-mem-intrinsics.ll lower-buffer-fat-pointers-mem-transfer.ll

[IRBuilder] Propagate nuw/nusw flags when canonicalizing GEP (#244592)

InstCombine's GEP index-width canonicalization in
InstCombinerImpl::visitGetElementPtrInst propagates the GEP's no-wrap
flags to the cast that adjusts the index width:
  nusw/nuw give trunc nsw/nuw
  nusw+nuw gives zext nneg when widening
That was added in commit a71909156e5.

Recently IRBuilder::CreateGEP started to canonicalize GEPs itself.
Support for that was added in commit ede30f6ce0. However, it used
CreateSExtOrTrunc, which drops the flags. When the index type was
already adjusted by IRBuilder, InstCombine never got to apply its
flag-preserving canonicalization, so the flags were lost.

This patch makes sure IRBuilder is using the same logic as InstCombine
when adjusting the index width.
DeltaFile
+163-0llvm/test/Transforms/InstCombine/gep-canonicalize-index-cast-flags.ll
+7-7llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-mem-transfer.ll
+6-6llvm/test/CodeGen/AMDGPU/lower-mem-intrinsics.ll
+9-2llvm/lib/IR/IRBuilder.cpp
+2-2llvm/test/Transforms/PreISelIntrinsicLowering/AMDGPU/memset-pattern.ll
+187-175 files

LLVM/project 7c7a907 — libcxx/include/__locale_dir locale_base_api.h, libcxx/include/__locale_dir/support aix.h

[libc++] Remove redundant `_LIBCPP_HIDE_FROM_ABI` from detail headers j-o (#244539)

This is the third bulk-removal patch of `_LIBCPP_HIDE_FROM_ABI`. While
this is something we could do over time, actively removing the redundant
annotations significantly improves readability, and QoI.
This happens in a few patches to keep the size somewhat manageable.
DeltaFile
+86-106libcxx/include/__memory/unique_ptr.h
+87-95libcxx/include/__optional/optional.h
+48-68libcxx/include/__math/rounding_functions.h
+45-55libcxx/include/__locale_dir/support/aix.h
+42-55libcxx/include/__mdspan/mdspan.h
+43-53libcxx/include/__locale_dir/locale_base_api.h
+351-432100 files not shown
+1,325-1,597106 files

LLVM/project 6516d75 — clang/lib/CIR/Lowering/DirectToLLVM LowerToLLVM.cpp, clang/test/CIR/CodeGenCXX relative-vtable-lookups.cpp

[CIR] Implement relative-vtable-lookups (#243798)

This patch handles lookups from a relative-vtable. While the rest of the
relative V-table work is quite large, this ends up being pretty easy to
split up. Effectively, we now just make sure we lower to the LLVM
dialect properly for loads of a relative Vtable.
DeltaFile
+134-0clang/test/CIR/CodeGenCXX/relative-vtable-lookups.cpp
+73-22clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+61-0clang/test/CIR/Lowering/vtable-relative-lookups.cir
+268-223 files

LLVM/project acffc35 — clang/lib/CIR/CodeGen CIRGenBuiltinAMDGPU.cpp

[CIR][AMDGPU] Remove redundant __builtin_amdgcn_lerp  case in CIRGen (#243235)

Removes the redundant __builtin_amdgcn_lerp case from `clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp` since EmitBuiltinExpr already lowers them automatically.

Reference PR  #222204
DeltaFile
+0-6clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp
+0-61 files

LLVM/project f5cb88e — clang/cmake/modules AddClang.cmake, clang/tools/libclang CMakeLists.txt

[LLVM][Clang] Fill Windows DLL version metadata (#243543)

LLVM and Clang DLLs leave their description and original filename empty
and omit copyright information from their Windows version resources.

Fill these fields, provide descriptions for the LLVM and Clang C
interface libraries, and record each target's actual output filename.
Give each target its own resource and keep the metadata attached to that
target so library creation cannot overwrite another target's metadata.
DeltaFile
+34-14llvm/cmake/modules/AddLLVM.cmake
+10-7clang/cmake/modules/AddClang.cmake
+3-1llvm/tools/llvm-shlib/CMakeLists.txt
+1-0clang/tools/libclang/CMakeLists.txt
+48-224 files

LLVM/project b487967 — mlir/lib/Dialect/LLVMIR/IR NVVMArithOps.cpp

narrow an include with llvm partitions landed
DeltaFile
+1-1mlir/lib/Dialect/LLVMIR/IR/NVVMArithOps.cpp
+1-11 files

LLVM/project 0188b25 — mlir/lib/Dialect/LLVMIR/IR NVVMMmaOps.cpp

clang-format
DeltaFile
+4-8mlir/lib/Dialect/LLVMIR/IR/NVVMMmaOps.cpp
+4-81 files

LLVM/project 666c397 — mlir/include/mlir/Dialect/LLVMIR NVVMOps.td

use inline let for single-record bodies instead of statement-let
DeltaFile
+17-31mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+17-311 files

LLVM/project 4f973a2 — mlir/include/mlir/Dialect/LLVMIR NVVMOps.td

address review comments
DeltaFile
+15-19mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+15-191 files

LLVM/project 5b64def — mlir/lib/Dialect/LLVMIR/IR NVVMMmaOps.cpp NVVMWgmmaOps.cpp

address review comments: align more with PTX doc grouping
DeltaFile
+1,355-0mlir/lib/Dialect/LLVMIR/IR/NVVMDataMovementOps.cpp
+0-1,179mlir/lib/Dialect/LLVMIR/IR/NVVMMemoryOps.cpp
+0-1,118mlir/lib/Dialect/LLVMIR/IR/NVVMTcgenOps.cpp
+1,118-0mlir/lib/Dialect/LLVMIR/IR/NVVMTcgen05Ops.cpp
+291-0mlir/lib/Dialect/LLVMIR/IR/NVVMWgmmaOps.cpp
+0-256mlir/lib/Dialect/LLVMIR/IR/NVVMMmaOps.cpp
+2,764-2,55322 files not shown
+3,113-3,09528 files

LLVM/project 766fcce — mlir/include/mlir/Dialect/LLVMIR NVVMAsyncCopyOps.h NVVMOps.td, mlir/lib/Dialect/LLVMIR/IR NVVMSyncOps.cpp NVVMMBarrierOps.cpp

address review comments
DeltaFile
+974-0mlir/lib/Dialect/LLVMIR/IR/NVVMAsyncCopyOps.cpp
+0-935mlir/lib/Dialect/LLVMIR/IR/NVVMDataMovementOps.cpp
+679-0mlir/lib/Dialect/LLVMIR/IR/NVVMMBarrierOps.cpp
+1-643mlir/lib/Dialect/LLVMIR/IR/NVVMSyncOps.cpp
+22-14mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+28-0mlir/include/mlir/Dialect/LLVMIR/NVVMAsyncCopyOps.h
+1,704-1,5928 files not shown
+1,746-1,60214 files

LLVM/project 0cf128d — mlir/lib/Dialect/LLVMIR/IR NVVMSyncOps.cpp NVVMTcgenOps.cpp

[mlir][NVVM] Partition the NVVM dialect ops

Including `NVVMDialect.h` is expensive. The header declares all 219 ops of the dialect regardless of how many ops are being used by an includer.
The dialect library pays the same price: each of its 12 TUs includes all op declarations through a precompiled `NVVMDialect.h`, including the 8 TUs that each define an eighth of the ops and `NVVMDialect.cpp`, which implements all of them.

This patch replaces the index sharding with op partitions ("logical sharding", #239254). The ops are grouped by topic into 10 partitions.
Every partition has its own header, which declares the ops of the partition, and its own source file, which defines them together with their hand-written implementations (verifiers, parsers, printers, builders, intrinsic lowerings, etc.).

`NVVMDialect.h` stays as an umbrella header that includes all partition headers, but its use is discouraged. Its includers in MLIR and flang now include what they use instead unless they require the majority of the headers.

Measurements where "Memory" is the sum of the max RSS of every TU, and the users are the TUs in MLIR outside the dialect library that include NVVM dialect headers:

| TUs                          | Compiler | Wall time (s)       | CPU time (s)       | Total memory (GiB)  |
|------------------------------|----------|---------------------|--------------------|---------------------|
| `MLIRNVVMDialect` (12 -> 14) | clang    | 22.3 -> 20.1 (-10%) | 208 -> 193 (-7%)   | 9.1 -> 8.6 (-5%)    |
| `MLIRNVVMDialect` (12 -> 14) | clang -g | 26.4 -> 24.8 (-6%)  | 241 -> 234 (-3%)   | 9.7 -> 9.1 (-6%)    |
| `MLIRNVVMDialect` (12 -> 14) | gcc      | 25.3 -> 21.9 (-13%) | 222 -> 198 (-11%)  | 14.9 -> 14.0 (-6%)  |
| `MLIRNVVMDialect` (12 -> 14) | gcc -g   | 36.8 -> 33.4 (-9%)  | 324 -> 296 (-9%)   | 21.0 -> 18.8 (-10%) |
| Users (10)                   | clang    | 27.8 -> 24.3 (-13%) | 176 -> 149 (-15%)  | 9.3 -> 8.0 (-14%)   |

    [3 lines not shown]
DeltaFile
+11-7,560mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+2,452-0mlir/lib/Dialect/LLVMIR/IR/NVVMMmaOps.cpp
+1,386-0mlir/lib/Dialect/LLVMIR/IR/NVVMConvertOps.cpp
+1,179-0mlir/lib/Dialect/LLVMIR/IR/NVVMMemoryOps.cpp
+1,118-0mlir/lib/Dialect/LLVMIR/IR/NVVMTcgenOps.cpp
+781-0mlir/lib/Dialect/LLVMIR/IR/NVVMSyncOps.cpp
+6,927-7,56041 files not shown
+8,443-7,64847 files

LLVM/project 81e0dbc — llvm/lib/Transforms/Coroutines CoroSplit.cpp

[coro] Remove renumberBlocks to fix assert (#244573)

GenericCycleInfo was not invalidated, so asserted when profcheck is
enabled that the block number epoche is outdated.

Remove the `renumberBlocks` call to fix this.
Given that e.g. `GenericCycleInfo` already uses the numbers as block
indices, they should still be sufficiently dense.
DeltaFile
+0-2llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+0-21 files

LLVM/project 7583443 — mlir/lib/Dialect/LLVMIR/IR NVVMDialect.cpp, mlir/test/Target/LLVMIR/nvvm convert_fp4x2.mlir convert_fp6x2.mlir

[MLIR][NVVM] Fix lowering of unscaled conversions on older architectures (#243009)

This patch fixes the lowering of unscaled `FP4` and `FP6` conversions 
to be supported on older architectures by lowering down to the 
existing unscaled intrinsics.

Lit tests are updated to reflect the same.

Assisted-by: Claude Code

Signed-off-by: DharuniRAcharya <dharunira at nvidia.com>
DeltaFile
+88-35mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+42-42mlir/test/Target/LLVMIR/nvvm/convert_fp6x2.mlir
+24-24mlir/test/Target/LLVMIR/nvvm/convert_fp4x2.mlir
+154-1013 files