LLVM/project 965d543 — mlir/lib/Conversion/GPUCommon GPUOpsLowering.cpp, mlir/lib/Conversion/GPUToROCDL LowerGpuOpsToROCDLOps.cpp

[mlir][LLVM] Include LLVM dialect partition headers instead of LLVMDialect.h (#242307)

Most includers of `LLVMDialect.h` use only a few LLVM dialect ops, or
none at all, but still pay for all 323 op declarations. Widely included
headers such as `OpenMPDialect.h`, `NVVMDialect.h` and `GPUCommonPass.h`
include it as well, spreading the cost to TUs that never use the LLVM
dialect.

Building on #242301, this patch makes every file include what it uses:
the partition headers of the ops it uses, `LLVMDialectDecl.h`,
`LLVMTypes.h`, `LLVMAttrs.h` or `LLVMInterfaces.h` if it only uses the
dialect, types, attributes or interfaces, and forward declarations where
a declaration suffices. Headers no longer include LLVM dialect headers
on behalf of their includers. Files that use ops from at least 8 of the
14 partitions keep `LLVMDialect.h`.

This reduces the TUs including `LLVMDialect.h` in an MLIR, flang and CIR
build from 386 to 41. Downstream code that relied on getting LLVM
dialect ops transitively has to include the partition headers it needs.

    [18 lines not shown]
DeltaFile
+12-1mlir/lib/Target/LLVMIR/ModuleImport.cpp
+11-1mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
+9-1mlir/lib/Conversion/LLVMCommon/Pattern.cpp
+8-1mlir/lib/Conversion/XeVMToLLVM/XeVMToLLVM.cpp
+8-1mlir/lib/Conversion/GPUToROCDL/LowerGpuOpsToROCDLOps.cpp
+8-1mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp
+56-6197 files not shown
+466-178203 files

LLVM/project 454c377 — llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 vector-shuffle-combining-avx2.ll

[X86] PALIGNR/PSHLDQ/PSRLDQ/VPERM2X128 targets shuffles never create undef/poison (#243806)

Add missing target shuffles that all hit
isGuaranteedNotToBeUndefOrPoisonForTargetNode in existing lit-tests to
help smoke out remaining FREEZE regressions for #243178 / #152107 etc.
DeltaFile
+32-26llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll
+8-0llvm/lib/Target/X86/X86ISelLowering.cpp
+40-262 files

LLVM/project 4154526 — llvm/include/llvm/IR Analysis.h

[IR] Increase the inline size of PreservedAnalyses::PreservedIDs (NFC) (#243624)

The current default triggers the large codepath (requiring non-trivial
heap allocation) in a large number of cases.

Update to use 8 elements inline, which avoids going to the heap in most
cases and improves compile-time:

stage1-O3: -0.06%
stage1-ReleaseThinLTO: -0.07%
stage1-ReleaseLTO-g: -0.05%
stage1-aarch64-O3: -0.06%
stage2-O3: -0.05%
stage2-clang: -0.09%


https://llvm-compile-time-tracker.com/compare.php?from=ce73ba2fc443a38847cc6da688ed22bc16fe0f8c&to=eb95dfd7244fb5ef7706f66502a143ac14fc23ff&stat=instructions:u

Assisted-by: Opus 5.5

PR: https://github.com/llvm/llvm-project/pull/243624
DeltaFile
+1-1llvm/include/llvm/IR/Analysis.h
+1-11 files

LLVM/project 0e82f6c — lldb/test lldbflakes.py, lldb/test/API lldbtest.py

[lldb] Don't re-run XFAILed tests (#243492)

Re-running tests that are expected to fail does not give useful signal.
This patch makes it so that they don't re-run.
DeltaFile
+10-1lldb/test/lldbflakes.py
+1-1lldb/test/Shell/helper/toolchain.py
+1-1lldb/test/API/lldbtest.py
+12-33 files

LLVM/project 10b4bf0 — mlir/lib/Dialect/Tosa/IR TosaOps.cpp, mlir/test/Dialect/Tosa verifier.mlir

[mlir][tosa]Check for non tensor type and fail gracefully (#243805)

Following error report
[llvm-project#236561](https://github.com/llvm/llvm-project/issues/236561)
added check for non tensor output type in TOSA block scaled type
verification.

Signed-off-by: Philip Wilkinson <philip.wilkinson at arm.com>
DeltaFile
+9-0mlir/test/Dialect/Tosa/verifier.mlir
+6-0mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+15-02 files

LLVM/project 0cc5830 — clang/include/clang/CIR/Dialect/Builder CIRBaseBuilder.h, clang/include/clang/CIR/Dialect/IR CIROps.td

[CIR] Use `cir.vec.fcmp` op for all fp vector comparisons (#241348)

Also removes support for floating point vectors from `cir.vec.cmp` op.

Claude helped with test updates.
DeltaFile
+0-150clang/test/CIR/Transforms/vector-cmp-fold.cir
+35-92clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+33-3clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+5-20clang/include/clang/CIR/Dialect/IR/CIROps.td
+0-15clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+3-12clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h
+76-2926 files not shown
+100-32912 files

LLVM/project 1531ce2 — llvm/lib/Target/X86 X86SchedLunarlakeP.td, llvm/test/tools/llvm-mca/X86/LunarlakeP resources-ssse3.s resources-sse1.s

[X86] Fix Lunar Lake ROB/RS sizes and FP ops on integer ports (#242473)

Address the data issues in X86SchedLunarlakeP.td reported in #209145:

- MicroOpBufferSize: the Lion Cove ROB has 576 entries.
- The integer scheduler has 120 reservation stations.
- (V)ADDSSrr/(V)SUBSSrr(_Int) use WriteFAdd: V2/V3, latency 2.
- (V)PALIGNRrri, VPALIGNRYrri and xmm VPBROADCAST{B,D,Q,W}rr run on the
vector shuffle ports V2/V3.

Measured on a Core Ultra 7 258V P-core with perf and
VEC_DISPATCHED.V0-V3: addss/subss (SSE and VEX) latency 2, 1 uop on
V2/V3, 0.5 cycles throughput; palignr/vpbroadcast xmm latency 1, 1 uop
on V2/V3, 0.5 cycles throughput. The model now matches both.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+11-11llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-avx2.s
+7-7llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-avx1.s
+4-8llvm/lib/Target/X86/X86SchedLunarlakeP.td
+5-5llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-sse1.s
+3-3llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-ssse3.s
+30-345 files

LLVM/project 58194d2 — clang/test/OpenMP target_no_loop.cpp

Adds test cases, addressing review comments
DeltaFile
+48-4clang/test/OpenMP/target_no_loop.cpp
+48-41 files

LLVM/project 35fec28 — mlir/include/mlir/Dialect/SPIRV/IR SPIRVNonUniformOps.td, mlir/test/Dialect/SPIRV/IR non-uniform-ops.mlir

[mlir][SPIR-V] Require matching types in GroupNonUniform arithmetic ops (#243773)

The spec requires Value to have the same type as Result Type, but the
shared op definition accepted mismatched types such as i32 -> i64
DeltaFile
+24-0mlir/test/Dialect/SPIRV/IR/non-uniform-ops.mlir
+1-0mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td
+25-02 files

LLVM/project d61e07b — .github/workflows libc-fullbuild-tests.yml

Create it as a new job
DeltaFile
+8-0.github/workflows/libc-fullbuild-tests.yml
+8-01 files

LLVM/project 030021a — .github/workflows libc-fullbuild-tests.yml

[libc] Enable baremetal Armv8.1-M.Main no-FP premerge tests
DeltaFile
+1-1.github/workflows/libc-fullbuild-tests.yml
+1-11 files

LLVM/project 8bb728d — llvm/lib/Target/AMDGPU AMDGPUMemoryUtils.h

[NFC] Remove some obsolete includes

They were needed for intermediate states of this PR, but the current
final state doesn't need them any more.
DeltaFile
+0-2llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+0-21 files

LLVM/project 5aa6dbc — llvm/lib/Target/AMDGPU SIMemoryLegalizer.cpp AMDGPUMemoryUtils.h

Remove std::optional from getSynchronizeAddrSpace's return type
DeltaFile
+7-7llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+6-7llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+3-6llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
+16-203 files

LLVM/project 97571c9 — llvm/lib/Target/AMDGPU AMDGPUMemoryUtils.cpp

Adjust to removed std::optional in getSynchronizeAddrSpace's return type.
DeltaFile
+2-5llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+2-51 files

LLVM/project 07247e2 — llvm/lib/Target/AMDGPU AMDGPUMemoryUtils.h SIMemoryLegalizer.cpp

Pass Function and DebugLoc instead of a Diag function to getSynchronizeAddrSpace

Implemented by AI, manually checked.

Assisted-by: AI
DeltaFile
+7-6llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+2-8llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
+5-3llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+14-173 files

LLVM/project 512b06d — llvm/lib/Target/AMDGPU AMDGPUMemoryUtils.cpp, llvm/test/CodeGen/AMDGPU noclobber-barrier.ll

[AMDGPU] Preserve noclobber after acquire operations from a different addrspace

Follow-up to #219991 to address reviewer comments:
AMDGPUAnnotateUniformValues should annotate uniform global loads as
`!amdgpu.noclobber` if the memory they are reading is never clobbered (since
kernel launch) before the load is executed.
PR #219991 strengthened the logic to consider acquire operations before the
load as clobbering (because they cause stores from other threads to be observed
by the load without a data race).

This PR weakens this criterion to ignore acquire operations that don't affect
the global address space (because they don't affect what the load in question
may or may not see). This addresses the performance-relevant case of s_barriers
with LDS-only fences.

The logic is still overly pessimistic for one-as load acquires, they could also
be ignored when looking for clobbering operations.

Disclaimer: Claude gave review comments and suggestions that I addressed during

    [5 lines not shown]
DeltaFile
+16-13llvm/test/CodeGen/AMDGPU/noclobber-barrier.ll
+12-2llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+28-152 files

LLVM/project c85e5c0 — llvm/lib/Target/AMDGPU AMDGPUMemoryUtils.cpp, llvm/test/CodeGen/AMDGPU implicit-kernarg-backend-usage.ll memory-legalizer-invalid-addrspace.mir

Put the toSIAtomicAddrSpace logic into a table and make it consistent with isExtendedGlobalAddrSpace

With that, the change is no longer NFC, since constant addrspaces and
addrspaces above `MAX_AMDGPU_ADDRESS` now map to `SIAtomicAddrSpace::GLOBAL`
instead of `OTHER`. This means that atomics on these addrspaces are no longer
rejected by SIMemoryLegalizer.

The tests only show differences in the generated ISA for volatile loads from
the constant addrspaces; so far we haven't waited directly after each such
volatile load, with this change we do. Arguably, these waits are unnecessary
since the accessed memory is not supposed to change, but, on the other hand,
one could argue that volatile accesses to memory that doesn't change are
pointless in the first place.
DeltaFile
+0-73llvm/test/CodeGen/AMDGPU/memory-legalizer-invalid-addrspace.mir
+20-17llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+8-14llvm/test/CodeGen/AMDGPU/GlobalISel/load-uniform-in-vgpr.ll
+14-8llvm/test/CodeGen/AMDGPU/implicit-kernarg-backend-usage.ll
+12-8llvm/test/CodeGen/AMDGPU/GlobalISel/implicit-kernarg-backend-usage-global-isel.ll
+5-8llvm/test/CodeGen/AMDGPU/GlobalISel/load-zero-and-sign-extending-uniform-in-vgpr.ll
+59-1284 files not shown
+72-13410 files

LLVM/project b1cdf92 — mlir/test/mlir-tblgen attr-type-partitions.td, mlir/tools/mlir-tblgen AttrOrTypeDefGen.cpp

Emit partition functions in the dialect namespace like ops

Co-authored-by: Claude <noreply at anthropic.com>
DeltaFile
+12-17mlir/test/mlir-tblgen/attr-type-partitions.td
+9-14mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+21-312 files

LLVM/project ecb9a58 — mlir/docs/DefiningDialects AttributesAndTypes.md, mlir/include/mlir/IR AttrTypeBase.td

Address review comments

Co-authored-by: Claude <noreply at anthropic.com>
DeltaFile
+18-15mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+5-5mlir/test/mlir-tblgen/attr-type-partitions.td
+4-4mlir/test/mlir-tblgen/attr-type-partitions-error.td
+4-4mlir/test/lib/Dialect/Test/CMakeLists.txt
+2-2mlir/include/mlir/IR/AttrTypeBase.td
+1-1mlir/docs/DefiningDialects/AttributesAndTypes.md
+34-316 files

LLVM/project 97c47c4 — llvm/include/llvm/Support FormatVariadic.h, mlir/tools/mlir-tblgen AttrOrTypeDefGen.cpp

add `StringLiteral` overload to `formatv`
DeltaFile
+5-5mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+4-0llvm/include/llvm/Support/FormatVariadic.h
+9-52 files

LLVM/project 16a77d4 — mlir/docs/DefiningDialects AttributesAndTypes.md

remove useless docs
DeltaFile
+0-12mlir/docs/DefiningDialects/AttributesAndTypes.md
+0-121 files

LLVM/project 24c64ca — mlir/test/lib/Dialect/Test TestAttributesSyntax.cpp TestAttributesCore.cpp, mlir/tools/mlir-tblgen AttrOrTypeDefGen.cpp

[mlir][ODS] Add partitions for attributes and types

Allow attributes and types to be grouped into named partitions, like
ops. Each def can set `partition` to a `Partition` record. Passing
`-attrdefs-partition=<name>` or `-typedefs-partition=<name>` to the
attrdef/typedef decls and defs generators then emits only the defs of
that partition. A large dialect can thus split its attributes and types
over several compilation units with narrower headers.

The implementation mirrors the approach used in op partitioning
with a `register<DialectClass>Attributes` function (or Types) is used to register every attribute (or type) of the dialect and dispatches to partition specific functions.
The `generated{Parser,Printer}` function saw the biggest change.
It is not generated as `generated<DialectClass>{Attribute,Type}{Parser,Printer}` which is a method with public linkage.
This method is also generated for non-partitioned dialects and the old `generated{Parser,Printer}` function soft-deprecated (but for now retained for migration purposes).

The additional testing, the test dialect's attributes and types are split into the
partitions `Core` and `Syntax`.
This roughly halves the compile time (15.1s -> 6.7s + 6.9s) and peak memory (721 MiB -> 385 and
376 MiB) of the largest test dialect attribute compilation unit.

    [2 lines not shown]
DeltaFile
+0-646mlir/test/lib/Dialect/Test/TestTypes.cpp
+0-611mlir/test/lib/Dialect/Test/TestAttributes.cpp
+502-0mlir/test/lib/Dialect/Test/TestTypesCore.cpp
+375-0mlir/test/lib/Dialect/Test/TestAttributesCore.cpp
+305-65mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+260-0mlir/test/lib/Dialect/Test/TestAttributesSyntax.cpp
+1,442-1,32248 files not shown
+2,437-1,70654 files

LLVM/project 93fe6e1 — mlir/docs/DefiningDialects AttributesAndTypes.md, mlir/include/mlir/IR TypeSupport.h AttributeSupport.h

[mlir][ODS] Generate hooks that register the attributes and types of a dialect

Dialects registered their generated attributes and types by expanding
`GET_ATTRDEF_LIST` (or `GET_TYPEDEF_LIST`) into the template arguments
of `addAttributes` (or `addTypes`).
This requires each and every type and attribute and their storage classes' to be defined at the callsite and is generally boilerplate that exists in most dialects.

This PR introduces a single registration hook that is generated by ODS and should be called from dialects' `initialize` method instead. The implementation of the hook now performs the registration.
The motivation and further advantage of this approach is that we can then also change the implementation of the registration method in ODS while keeping API compatibility. This is required for partitioning of attributes and types e.g. (https://github.com/llvm/llvm-project/pull/241935).

Docs have been updated to advise users to use the new registration method. However, no upstream dialect beyond the test dialect has been switched nor is the old method of registration planned to be deprecated as it is still useful in some contexts (e.g., extendible dialects or C++ defined types and attributes).

Co-authored-by: Claude <noreply at anthropic.com>
DeltaFile
+33-0mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+11-12mlir/docs/DefiningDialects/AttributesAndTypes.md
+13-0mlir/lib/IR/MLIRContext.cpp
+13-0mlir/include/mlir/IR/TypeSupport.h
+13-0mlir/include/mlir/IR/AttributeSupport.h
+10-0mlir/test/mlir-tblgen/typedefs.td
+93-124 files not shown
+106-2010 files

LLVM/project 5966b6a — mlir/docs/DefiningDialects AttributesAndTypes.md, mlir/test/mlir-tblgen attrdefs.td

[mlir][ODS] Let the generated dispatch parsers use an already parsed mnemonic (#243474)

The generated `generatedAttributeParser` and `generatedTypeParser`
always parsed the mnemonic themselves. A dialect whose attributes or
types are generated into several files therefore could not try the
dispatch functions of each file in turn, since the first one already
consumed the token.

The fix is just to pass `*mnemonic` on to the `KeywordSwitch`, which
only parses the mnemonic if it is empty. All in-tree callers already
pass an empty mnemonic.

Split out of https://github.com/llvm/llvm-project/pull/241935
DeltaFile
+4-2mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+2-1mlir/docs/DefiningDialects/AttributesAndTypes.md
+1-1mlir/test/mlir-tblgen/attrdefs.td
+7-43 files

LLVM/project 2be638a — libc/cmake/caches armv8.1m.main-none-eabi.cmake, libc/cmake/caches/arm-testing armv8.1m.main-none-eabi.cmake

Move it to a new cache file in a dedicated folder
DeltaFile
+54-0libc/cmake/caches/arm-testing/armv8.1m.main-none-eabi.cmake
+1-47libc/cmake/caches/armv8.1m.main-none-eabi.cmake
+55-472 files

LLVM/project 83c7dd9 — llvm/lib/Transforms/Vectorize VPlanUtils.cpp VPlanUnroll.cpp, llvm/test/Transforms/LoopVectorize/VPlan epilogue-resume-interleaved.ll

[VPlan] Rework usesFirstPartOnly (#237986)

The recursive first-part reasoning in VPInstruction is dead, and this
allows us to make the more general observation that usesFirstPartOnly is
a misnomer: whether or not the first part of a recipe is used never
depends on the recipe itself, and is entirely determined by whether the
user is statically determined to be a first-part user. Accordingly,
strip the redundant argument. As part of the rework, make the sole
onlyFirstPartUsed call more principled. The end result is a technically
correct change of ResumeForEpilogue being cloned per-part, as evidenced
in VPlan printing.

Assisted-by: llm, for testing
DeltaFile
+68-0llvm/test/Transforms/LoopVectorize/VPlan/epilogue-resume-interleaved.ll
+8-15llvm/lib/Transforms/Vectorize/VPlan.h
+1-10llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+2-7llvm/lib/Transforms/Vectorize/VPlanValue.h
+5-2llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp
+1-1llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+85-356 files

LLVM/project 4f2620f — utils/bazel/llvm-project-overlay/mlir BUILD.bazel

[Bazel] Fixes d3cb251 (#243796)

This fixes d3cb251541f3e59a866bb0702b32e942b3a54fe6 (#242301).

Buildkite error link:
https://buildkite.com/llvm-project/upstream-bazel/builds?commit=d3cb251541f3e59a866bb0702b32e942b3a54fe6

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+54-21utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+54-211 files

LLVM/project 59c4ba9 — llvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/InstCombine add.ll

[ValueTracking] Union select operand ranges in the requested signedness. (#243465)

Similar to https://github.com/llvm/llvm-project/pull/242706, pass
preferred signed-ness to unionWith to improve results in some cases.

End-to-end this strengthens flags in a number of cases:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/2045

PR: https://github.com/llvm/llvm-project/pull/243465
DeltaFile
+26-0llvm/test/Transforms/InstCombine/add.ll
+2-1llvm/lib/Analysis/ValueTracking.cpp
+28-12 files

LLVM/project 2eb41e5 — mlir/test/mlir-tblgen attr-type-partitions.td, mlir/tools/mlir-tblgen AttrOrTypeDefGen.cpp

Emit partition functions in the dialect namespace like ops

Co-authored-by: Claude <noreply at anthropic.com>
DeltaFile
+12-17mlir/test/mlir-tblgen/attr-type-partitions.td
+9-14mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+21-312 files

LLVM/project 2465797 — mlir/docs/DefiningDialects AttributesAndTypes.md, mlir/include/mlir/IR AttrTypeBase.td

Address review comments

Co-authored-by: Claude <noreply at anthropic.com>
DeltaFile
+18-15mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp
+5-5mlir/test/mlir-tblgen/attr-type-partitions.td
+4-4mlir/test/mlir-tblgen/attr-type-partitions-error.td
+4-4mlir/test/lib/Dialect/Test/CMakeLists.txt
+2-2mlir/include/mlir/IR/AttrTypeBase.td
+1-1mlir/docs/DefiningDialects/AttributesAndTypes.md
+34-316 files