LLVM/project bb30496 — mlir/lib/Dialect/X86/Transforms VectorContractToAMXDotProduct.cpp, mlir/test/Dialect/X86/AMX vector-contract-to-tiled-dp.mlir

[mlir][x86] Accumulate AMX VNNI tiles in place (#233388)

Accumulate AMX VNNI contraction results in place instead of through
temporary storage when the accumulator and result support direct tile
accesses.

This reduces memory traffic and improves performance for contractions in
VNNI layout with a non-zero accumulator.

Assisted-by: Claude
DeltaFile
+110-4mlir/lib/Dialect/X86/Transforms/VectorContractToAMXDotProduct.cpp
+8-5mlir/test/Dialect/X86/AMX/vector-contract-to-tiled-dp.mlir
+118-92 files

LLVM/project 005b0ce — llvm/lib/CodeGen MachineVerifier.cpp, llvm/test/MachineVerifier dead-def-aliasing.mir

MachineVerifier: Reject dead and live defs of the same register (#233110)

Previously an instruction could have a dead and a live def of the same
physical register, which has no consistent interpretation.

Some passes, namely register pressure tracking, implicitly rely on the
dead flag adjustments performed by running LiveVariables. In cases of
repeated defs, LiveVariables strips dead flags. When a super-register
is only partially used, it marks the super-register def dead and adds
a live implicit-def of the used sub-register.

Prior to #222627, pressure tracking treated live defs as winning. That
PR fixed some asserts by switching to a dead wins system where any
dead flag taints those regunits for the whole instruction. #225079
reverts the remainder of #222627, back closer to the interpretation of
this verifier check.

Only a dead def with a live def of the same register is
rejected. Mixed dead flags on overlapping defs of different registers

    [6 lines not shown]
DeltaFile
+76-0llvm/test/MachineVerifier/dead-def-aliasing.mir
+33-0llvm/lib/CodeGen/MachineVerifier.cpp
+109-02 files

LLVM/project 6feaed7 — clang/lib/AST/ByteCode EvalEmitter.cpp, clang/test/AST/ByteCode cxx2a.cpp

[clang][bytecode] Always check for initialization in RetValue (#233189)

Since we always call `toRValue()` here, all the fields we read need to
be initialized.

Fixes https://github.com/llvm/llvm-project/issues/232904
DeltaFile
+15-0clang/test/AST/ByteCode/cxx2a.cpp
+1-1clang/lib/AST/ByteCode/EvalEmitter.cpp
+16-12 files

LLVM/project d085ffa — clang/lib/CodeGen CodeGenAction.cpp, llvm/include/llvm/IR LLVMContext.h

[llvm][clang] Store the VFS on LLVMContext (#232879)

Backend code occasionally has to resolve an input path: for example
`AsmPrinter` records an absolute path to the optimization record in the
remarks section, and the integrated assembler resolves `.include`
directives coming from inline asm.

Using `llvm::sys::fs` or `llvm::MemoryBuffer::getFile*()` APIs violates
the IO sandbox, which is currently on by default for Clang with
assertions enabled. To comply with the sandbox, this PR stores the
proper VFS on `LLVMContext`, making it available to the LLVM side.

Clients that do not enable the IO sandbox do not need to change, and
will default to using `llvm::vfs::getRealFileSystem()`.

NFC, since nothing uses the VFS yet.
DeltaFile
+11-0llvm/lib/IR/LLVMContext.cpp
+11-0llvm/include/llvm/IR/LLVMContext.h
+4-0llvm/lib/IR/LLVMContextImpl.h
+2-0clang/lib/CodeGen/CodeGenAction.cpp
+28-04 files

LLVM/project 0a5d999 — llvm/test/CodeGen/SPIRV/debug-info debug-composite-parent-debuginfonone.ll

Fix test that required a specific emission order.
DeltaFile
+22-20llvm/test/CodeGen/SPIRV/debug-info/debug-composite-parent-debuginfonone.ll
+22-201 files

LLVM/project c9f4a9e — flang/lib/Optimizer/Transforms FIRToMemRef.cpp, flang/test/Transforms/FIRToMemRef nontemporal.mlir

[flang][FIRToMemRef] Propagate nontemporal to the memref ops (#233420)

rewriteLoadOp/rewriteStoreOp forwarded only the tbaa attribute, so the
nontemporal flag set on fir.load/fir.store was silently dropped when
they were replaced by memref.load/memref.store, which model it as well.
DeltaFile
+32-0flang/test/Transforms/FIRToMemRef/nontemporal.mlir
+6-0flang/lib/Optimizer/Transforms/FIRToMemRef.cpp
+38-02 files

LLVM/project 3183595 — clang/lib/AST/ByteCode Interp.cpp

[clang][bytecode][NFC] Make string pointer check more explicit (#233360)

We already handled block pointers above, so the isReadablePointerType()
check here is equivalent to isStringPointer().
DeltaFile
+1-1clang/lib/AST/ByteCode/Interp.cpp
+1-11 files

LLVM/project 867e826 — llvm/lib/IR Instruction.cpp, llvm/lib/Transforms/Utils FunctionComparator.cpp

[IR] Compare the cleanup flag of landingpads (#233424)

The cleanup flag is stored in subclass data, so neither
Instruction::hasSameSpecialState nor FunctionComparator::cmpOperations
looked at it. A `cleanup catch` landingpad was treated as identical to a
plain `catch` which caused SimplifyCFG to merge such landing pads, and
MergeFunctions to merge functions that only differed in it. Either way the
cleanup code is skipped, or run for exceptions it should not see.
DeltaFile
+66-0llvm/test/Transforms/MergeFunc/landingpad-cleanup.ll
+52-0llvm/test/Transforms/SimplifyCFG/duplicate-landingpad.ll
+2-0llvm/lib/Transforms/Utils/FunctionComparator.cpp
+2-0llvm/lib/IR/Instruction.cpp
+122-04 files

LLVM/project 1e70f75 — mlir/include/mlir/Dialect/Tosa/IR TosaOps.td, mlir/lib/Dialect/Tosa/IR TosaOps.cpp

[mlir][tosa] Simplify pad shape inference and verification (#233064)

Treat constant padding amounts as ordinary integers during shape
inference. Remove the example assigning a dynamic-padding meaning to
negative values.

Keep PadOp verification local to operand and result types. Check padding
length through its shape type and drop checks of constant operand
contents and derived output extents.

Assisted-by: Codex
DeltaFile
+3-41mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+5-13mlir/test/Dialect/Tosa/verifier.mlir
+11-0mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
+0-8mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
+19-624 files

LLVM/project 6fb51f5 — mlir CMakeLists.txt

[MLIR] Default PDL off for dependency-only builds (#233108)

Default PDL support in PatternMatch to off whenever MLIR is configured
only as a dependency. Keep the existing default for explicitly enabled
MLIR builds and preserve user-provided PDL settings. This speeds up
clang build with CIR enabled.

Assisted-by: Codex
DeltaFile
+9-1mlir/CMakeLists.txt
+9-11 files

LLVM/project ddfd7d1 — lldb/test/API/api/multiple-debuggers TestMultipleDebuggers.py

[lldb][test] Disable TestMultipleDebuggers.py on Windows on Arm (#233429)

It has been flaky on our buildbot. See #233425.
DeltaFile
+2-0lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py
+2-01 files

LLVM/project b3c058e — llvm/lib/Target/AMDGPU AMDGPUTargetTransformInfo.cpp

[SLP][AMDGPU] Update once-used-seeds test, drop override comment

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+1-9llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+1-91 files

LLVM/project e8d4dec — llvm/include/llvm/Analysis TargetTransformInfo.h, llvm/lib/Analysis TargetTransformInfo.cpp

[SLP] Let targets choose the default for -slp-vectorize-once-used

instructions with a single user as standalone seeds after all other
roots are exhausted. It is on by default for every target. Our
downstream AMDGPU toolchain has disabled it since it was introduced,
because it does not pay off for AMDGPU, by changing the option's
default. That is a local divergence from upstream which has to be
carried, and re-checked, through every merge; the recent move of the
vectorizer options into TableGen (#231025) is one such case.

Make the default target-dependent instead, so the setting can live
upstream. Add TTI::preferSLPOnceUsedSeeds(), true by default, so each
target can pick the value that suits its performance, and have AMDGPU
return false. -slp-vectorize-once-used becomes an optional flag that,
when given, overrides the target, as -vectorizer-consider-reg-pressure
does for TTI::shouldConsiderVectorizationRegPressure().

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+9-8llvm/test/Transforms/SLPVectorizer/AMDGPU/once-used-seeds.ll
+10-0llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+5-0llvm/include/llvm/Analysis/TargetTransformInfo.h
+4-0llvm/lib/Analysis/TargetTransformInfo.cpp
+1-1llvm/lib/Transforms/Vectorize/VectorizeOptions.td
+1-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+30-102 files not shown
+33-108 files

LLVM/project 0550bf3 — llvm/test/Transforms/SLPVectorizer/AMDGPU once-used-seeds.ll

[SLP][AMDGPU] Regenerate once-used-seeds.ll checks for the subarch triple

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+1-1llvm/test/Transforms/SLPVectorizer/AMDGPU/once-used-seeds.ll
+1-11 files

LLVM/project 103b621 — llvm/docs LangRef.md

[LangRef] Relax the LLVM IR data race definition

The current LangRef rules categorize some surprising (to me) cases as data
races (more specifically: they define loads to return `undef` in surprising
situations).

At the core of the problem is the requirement that, if a read R may see more
than one write, R and all the writes it may see must be atomic, otherwise R
returns `undef`. That means that, if an atomic write W and an atomic read R
execute concurrently, a non-atomic write W' that happens-before both of them
causes R to return `undef`. We get that situation if W' initializes the
location in a sequential portion of the program, followed by proper
synchronization before a parallel portion of the program where W and R take
place.

Some litmus tests for the problem:

1. A non-atomic store that happens-before an atomic store and an atomic load:
```

    [56 lines not shown]
DeltaFile
+17-11llvm/docs/LangRef.md
+17-111 files

LLVM/project afcace8 — llvm/lib/Transforms/Utils SimplifyLibCalls.cpp, llvm/test/Transforms/InstCombine exp2-to-ldexp.ll exp2-1.ll

Update for comments
DeltaFile
+11-10llvm/test/Transforms/InstCombine/exp2-1.ll
+8-6llvm/test/Transforms/InstCombine/exp2-to-ldexp.ll
+4-3llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+23-193 files

LLVM/project db70091 — llvm/lib/Transforms/Utils SimplifyLibCalls.cpp, llvm/test/Transforms/InstCombine pow_fp_int16.ll pow_fp_int.ll

[InstCombine] Fold exp2(uitofp x) to ldexp(1.0, x) with ninf

`exp2(uitofp iN x) -> ldexp(1.0, zext x)` currently requires N to be
narrower than `int`, because `ldexp` takes a signed `int` exponent.
When N equals the width of `int`, the fold is still correct under `ninf`.
Every LLVM FP type has $E_{\max} \le 16383 < 2^{15} \le 2^{N-1}$, so:

- $x < 2^{N-1}$: signed and unsigned $x$ agree, so $\operatorname{ldexp}(1.0, x) = 2^{x} = \operatorname{exp2}(x)$.
- $x \ge 2^{N-1}$: $\operatorname{exp2}(x) \ge 2^{2^{N-1}} > 2^{E_{\max}}$ overflows to $+\infty$, which is poison under `ninf`.

This only applies to the intrinsic, since the `exp2` libcall may set
`errno` on overflow.

This also enables `pow(2.0, uitofp x) -> ldexp` via the existing
`pow(2^n, x) -> exp2(n * x)` fold.
DeltaFile
+23-30llvm/test/Transforms/InstCombine/exp2-to-ldexp.ll
+33-18llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+8-12llvm/test/Transforms/InstCombine/exp2-1.ll
+4-4llvm/test/Transforms/InstCombine/pow-to-ldexp.ll
+3-4llvm/test/Transforms/InstCombine/pow_fp_int16.ll
+3-4llvm/test/Transforms/InstCombine/pow_fp_int.ll
+74-726 files

LLVM/project 4b24a9e — llvm/test/Transforms/InstCombine pow_fp_int16.ll

[InstCombine] Autogenerate test checks in pow_fp_int16.ll. NFC
DeltaFile
+121-84llvm/test/Transforms/InstCombine/pow_fp_int16.ll
+121-841 files

LLVM/project b1f7077 — clang/lib/Driver/ToolChains Flang.cpp, flang/docs ReleaseNotes.md

[flang] Add -f[no-]version-loops-for-trip-count and enable it at -O3
DeltaFile
+36-0flang/test/Integration/loop-tripcount-versioning.f90
+34-0flang/test/Driver/version-loops-trip-count.f90
+14-11clang/lib/Driver/ToolChains/Flang.cpp
+5-0flang/lib/Optimizer/Passes/CommandLineOpts.cpp
+5-0flang/docs/ReleaseNotes.md
+4-0flang/lib/Optimizer/Passes/Pipelines.cpp
+98-116 files not shown
+111-1112 files

LLVM/project 3b0f229 — flang/include/flang/Optimizer/Passes CommandLineOpts.h, flang/lib/Optimizer/Passes Pipelines.cpp CommandLineOpts.cpp

[flang] Plumb -loop-tripcount-versioning-max-unrolled-ops through the pipeline
DeltaFile
+5-0flang/lib/Optimizer/Passes/CommandLineOpts.cpp
+2-1flang/lib/Optimizer/Passes/Pipelines.cpp
+1-0flang/include/flang/Optimizer/Passes/CommandLineOpts.h
+8-13 files

LLVM/project bb22abf — clang/lib/Driver/ToolChains Flang.cpp, flang/test/Driver version-loops-trip-count.f90

[flang][driver] Honor trailing -O0 and test -mmlir overrides for trip-count versioning
DeltaFile
+30-0flang/test/Integration/loop-tripcount-versioning.f90
+8-5clang/lib/Driver/ToolChains/Flang.cpp
+9-0flang/test/Driver/version-loops-trip-count.f90
+47-53 files

LLVM/project 87e044c — llvm/test/Transforms/InstCombine exp2-1.ll exp2-to-ldexp.ll

[InstCombine] Pre-commit tests for exp2(uitofp) -> ldexp with ninf. NFC (#227377)

Add baseline tests for folding `exp2(uitofp iN x)` to `ldexp(1.0, x)`
when N equals the width of C int, including negative tests (no ninf,
source wider than int, libcall).
DeltaFile
+234-0llvm/test/Transforms/InstCombine/exp2-to-ldexp.ll
+160-3llvm/test/Transforms/InstCombine/exp2-1.ll
+394-32 files

LLVM/project cd63e2d — flang/include/flang/Optimizer/Transforms Passes.td

[flang] Document the device-code exclusion and unroll-limit proxy in LoopTripCountVersioning
DeltaFile
+14-9flang/include/flang/Optimizer/Transforms/Passes.td
+14-91 files

LLVM/project 2d6f180 — clang/lib/CIR/Lowering LoweringHelpers.cpp, clang/lib/CIR/Lowering/DirectToLLVM LowerToLLVM.cpp

[CIR] Lower array globals with many trailing zeros as packed structs (#232835)

A global such as `T x[NUM_ELEMENTS] = {1}` reaches LLVM lowering as a
`#cir.const_array` with one explicit element and NUM_ELEMENTS trailing
zeros.
When NUM_ELEMENTS is large that lowering becomes impractical and slow.
This PR fixes such cases by following OG:
1. when there are 8 or more explicit elements of the same type,
the array is lowered as a packed struct with a trailing zero-initialized
array.
2. When an array initializer ends in 8 or more zeros,
the array is lowered as a packed struct with the explicit elements
followed by one zero-initialized array.

`cxx11-initializer-aggregate.cpp` earlier the compilation was
not completing on my system. Now the test compiles 
with -fclangir in about 0.1s, and its huge-array globals match classic
codegen. Several
existing tests now produce the same output as classic codegen for

    [25 lines not shown]
DeltaFile
+198-0clang/test/CIR/CodeGen/cxx11-initializer-aggregate.cpp
+127-11clang/lib/CIR/Lowering/LoweringHelpers.cpp
+85-0clang/test/CIR/Lowering/const-array-trailing-zeros.cir
+41-14clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+39-0clang/test/CIR/CodeGen/array-trailing-zeros.cpp
+12-7clang/test/CIR/CodeGen/union-init-padding-array.c
+502-328 files not shown
+527-4914 files

LLVM/project d945bf2 — llvm/test/Transforms/SLPVectorizer/AMDGPU once-used-seeds.ll

[SLP][AMDGPU] Precommit test for once-used seeds (NFC)

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+33-0llvm/test/Transforms/SLPVectorizer/AMDGPU/once-used-seeds.ll
+33-01 files

LLVM/project e125dd2 — llvm/test/Transforms/SLPVectorizer/AMDGPU once-used-seeds.ll

Update llvm/test/Transforms/SLPVectorizer/AMDGPU/once-used-seeds.ll

Co-authored-by: Jay Foad <jay.foad at amd.com>
DeltaFile
+1-1llvm/test/Transforms/SLPVectorizer/AMDGPU/once-used-seeds.ll
+1-11 files

LLVM/project 3546bc6 — libc/src/__support/OSUtil/linux/syscall_wrappers CMakeLists.txt sched_get_priority_min.h, libc/src/sched/linux CMakeLists.txt sched_get_priority_min.cpp

[libc] Use a syscall wrapper for `sched_get_priority_min` (#233409)

This PR move `sched_get_priority_min` behind the centralized syscall
wrappers, following `libc/docs/dev/syscall_wrapper_refactor.md`.
DeltaFile
+34-0libc/src/__support/OSUtil/linux/syscall_wrappers/sched_get_priority_min.h
+28-0utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+5-8libc/src/sched/linux/sched_get_priority_min.cpp
+12-0libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
+4-2libc/src/sched/linux/CMakeLists.txt
+83-105 files

LLVM/project 5b0621a — clang/test/OffloadTools/clang-linker-wrapper linker-wrapper.c, clang/tools/clang-linker-wrapper ClangLinkerWrapper.cpp

[ClangLinkerWrapper] Emit extra job to generate -save-temps assembly (#224446)

Summary:
This is an oft-requested feature and unfortunately cannot be done
easily. The approach is just to make a redundant job that does the same
handling, but emits an `--lto-emit-asm` job in the background. Ideally
these get enough parallelism that the total compile time doesn't change
much.

I cannot find a cleaner way to return the 'old driver behavior' for
emitting assembly as was requested. THe LTO pipeline is not built to
generate intermediate files like this, and running this *then* consuming
the assembly on output would break thinLTO, partitioned LTO, or future
object linking.
DeltaFile
+38-10clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+6-0clang/test/OffloadTools/clang-linker-wrapper/linker-wrapper.c
+44-102 files

LLVM/project 90205f6 — libc/config/linux/aarch64 entrypoints.txt, libc/config/linux/arm entrypoints.txt

[libc] Move setxid entrypoints to experimental (#233416)

POSIX requires functions that change credentials (setuid, setgid,
setreuid, setregid, setgroups, initgroups) to affect all threads in a
process. On Linux, the underlying kernel syscalls operate per-thread.
Propagating these changes across all threads requires setxid signal
machinery, which we do not have yet.

Move these entry points to experimental on Linux targets and add a TODO
to their implementations.

Assisted-by: Gemini
DeltaFile
+10-6libc/config/linux/x86_64/entrypoints.txt
+10-6libc/config/linux/riscv/entrypoints.txt
+10-6libc/config/linux/arm/entrypoints.txt
+10-6libc/config/linux/aarch64/entrypoints.txt
+8-2libc/config/linux/i386/entrypoints.txt
+1-0libc/src/unistd/linux/setuid.cpp
+49-266 files not shown
+55-2612 files

LLVM/project e6146a7 — lldb/test/API/api/multithreaded/stop_hook TestMultithreadedStopHook.py

[lldb][test] Skip TestMultithreadedStopHook.py on all Linux (#233422)

Failures have been reported in x86_64 premerge jobs: ERROR: test
(TestMultithreadedStopHook.MultithreadedStopHookTestCase.test)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py",
line 221, in wrapper
    return func(*args, **kwargs)
File
"/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/test/API/api/multithreaded/stop_hook/TestMultithreadedStopHook.py",
line 19, in test
self.buildAndRunDriver("driver.cpp test_stop-hook.cpp", "inferior.cpp")
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py",
line 1877, in buildAndRunDriver
    check_call(

    [18 lines not shown]
DeltaFile
+3-3lldb/test/API/api/multithreaded/stop_hook/TestMultithreadedStopHook.py
+3-31 files