LLVM/project 386e356clang/docs ReleaseNotes.rst, clang/lib/AST MicrosoftMangle.cpp

[AArch64] Add support for MSVC-style mangling for SVE (#196738)

Fixes #196170

Recent MSVC toolchains added support for AArch64 SVE types and use
dedicated builtin manglings such as `$_CD` instead of the older
artificial `__clang` struct manglings.

Update Clang's Microsoft mangling implementation to match MSVC for
supported SVE builtin types.

Unsupported SVE types continue using the existing artificial tag
mangling until MSVC gains support for them.

Adds representative coverage for:
* scalar SVE types
* tuple/vector SVE types
* fallback manglings for unsupported types
DeltaFile
+194-6clang/lib/AST/MicrosoftMangle.cpp
+50-8clang/test/CodeGenCXX/aarch64-mangle-sve-vectors-msvc.cpp
+3-0clang/docs/ReleaseNotes.rst
+247-143 files

LLVM/project 03c8a83libcxx/include string tuple, libcxx/include/__configuration hardening.h

[libc++] Address most LLVM23 TODOs (#199397)

There is still one LLVM23 TODO left that can only be resolved once we
update GCC.
DeltaFile
+0-17libcxx/include/__configuration/hardening.h
+2-12libcxx/include/string
+1-6libcxx/include/tuple
+3-353 files

LLVM/project 189fb5aclang/include/clang/Analysis/Analyses/LifetimeSafety LifetimeAnnotations.h, clang/lib/Analysis/LifetimeSafety FactsGenerator.cpp LifetimeAnnotations.cpp

[LifetimeSafety] Propagate inner origins through std::move and related casts
DeltaFile
+37-5clang/test/Sema/warn-lifetime-safety.cpp
+12-5clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+15-0clang/lib/Analysis/LifetimeSafety/LifetimeAnnotations.cpp
+5-0clang/include/clang/Analysis/Analyses/LifetimeSafety/LifetimeAnnotations.h
+3-0clang/test/Sema/Inputs/lifetime-analysis.h
+72-105 files

LLVM/project 50a110allvm/lib/CodeGen CodeGenPrepare.cpp, llvm/test/Transforms/CodeGenPrepare/X86 split-store-alignment.ll

[CodeGenPrepare] splitMergedValStore: don't split atomic stores. (#199592)

splitMergedValStore notices when you do e.g.

    z = x | (y << 32)
    store z

and may split this up into 32-bit two stores, of x and y, depending
e.g. on the type of x and y.

It skips this optimization for volatile stores, but currently does NOT
skip it for atomics (!!).  So an atomic store can be split up into two
(non-atomic!) stores.

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply at anthropic.com>
DeltaFile
+60-0llvm/test/Transforms/CodeGenPrepare/X86/split-store-alignment.ll
+2-2llvm/lib/CodeGen/CodeGenPrepare.cpp
+62-22 files

LLVM/project d1902d3llvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV rvp-bitcast-const-fold.ll

[RISCV][P-ext] Fold bitcast of v4i8/v2i16 const splat to scalar on RV64 (#199513)

clang lowers `int8x4_t f(int8x4_t a) { return ~a; }` to a
bitcast-wrapped vector xor with splat(-1). v4i8/v2i16 aren't legal on
RV64, so the xor gets scalarized to i64 with the constant still wrapped
in BITCAST:
      `i64 = xor X, (bitcast (v8i8 splat -1))`

The scalar `not` PatFrag (xor X, -1) requires a literal constant and
can't see through BITCAST, so XORI -1 (= `not`) misses and we emit `li
-1; xor` (2 insns). The v8i8/v4i16/v2i32 paths stay at vector level and
match the bitcast-aware vector `vnot` td-pat, so they're fine; only the
widened-from-v4i8/v2i16 path falls through to scalar `not`.

Fix it by folding the bitcast of a v4i8/v2i16 constant splat to a scalar
i32 constant pre-legalization. Type promotion sign-extends to i64 -1 and
XORI matches.
DeltaFile
+90-0llvm/test/CodeGen/RISCV/rvp-bitcast-const-fold.ll
+24-2llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+114-22 files

LLVM/project 5723dd0llvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV rvp-simd-64.ll

[RISCV][P-ext] Split v4i16/v8i8 MUL on RV32. (#199504)
DeltaFile
+8-68llvm/test/CodeGen/RISCV/rvp-simd-64.ll
+4-3llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+12-712 files

LLVM/project b929dballvm/lib/Target/X86 X86FixupInstTuning.cpp

[X86] FixupInstTuning: ProcessShiftLeftToAdd should return true after mutating. (#199589)

I think this is almost NFC, though it should affect some of the
compilation statistics like "number of instrs changed by X pass".

This bug was found by a large run of Opus 4.7 looking for bugs in LLVM.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply at anthropic.com>
DeltaFile
+1-1llvm/lib/Target/X86/X86FixupInstTuning.cpp
+1-11 files

LLVM/project 7dabf94llvm/lib/CodeGen/SelectionDAG LegalizeIntegerTypes.cpp, llvm/test/CodeGen/RISCV/rvv pr199509.ll

[SelectionDAG] Handle CSE in PromoteIntOp_VP_STRIDED. (#199562)

If the UpdateNodeOperands triggers CSE, we need to handle result
replacement ourselves because strided load has 2 results.
DeltaFile
+17-0llvm/test/CodeGen/RISCV/rvv/pr199509.ll
+7-1llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+24-12 files

LLVM/project b938d8bllvm/include/llvm/Analysis DependenceAnalysis.h, llvm/lib/Analysis DependenceAnalysis.cpp

[DA] Consolidate accumulating GCD functions (NFCI) (#197936)

This patch consolidates two functions `accumulateCoefficientsGCD` and
`analyzeCoefficientsForGCD` by merging the latter into the former. These
two functions are very similar, and keeping both of them does not make
much sense.
DeltaFile
+11-29llvm/lib/Analysis/DependenceAnalysis.cpp
+5-5llvm/include/llvm/Analysis/DependenceAnalysis.h
+16-342 files

LLVM/project fb35b3eclang/lib/Driver OffloadBundler.cpp, clang/test/Driver clang-offload-bundler-multi-compress.c

Merge branch 'main' into users/kasuga-fj/da-consolidate-acc-gcd
DeltaFile
+451-0llvm/test/Transforms/LoopVectorize/select-cmp-blend-chain.ll
+0-323llvm/test/Transforms/LoopVectorize/X86/constant-fold.ll
+200-116clang/lib/Driver/OffloadBundler.cpp
+272-0llvm/test/Transforms/LoopVectorize/VPlan/constant-fold.ll
+187-0clang/test/Driver/clang-offload-bundler-multi-compress.c
+0-183compiler-rt/lib/asan/asan_poisoning.cpp
+1,110-62242 files not shown
+1,480-1,08248 files

LLVM/project 9b64fa9llvm/lib/Analysis DependenceAnalysis.cpp

address reivew comment
DeltaFile
+0-1llvm/lib/Analysis/DependenceAnalysis.cpp
+0-11 files

LLVM/project 3ad6af9mlir/docs Tokens.md LangRef.md

address comments: symbols / IsolatedFromAbove
DeltaFile
+6-1mlir/docs/Tokens.md
+1-2mlir/docs/LangRef.md
+7-32 files

LLVM/project 955ba23mlir/docs Tokens.md

Update mlir/docs/Tokens.md

Co-authored-by: Mehdi Amini <joker.eph at gmail.com>
DeltaFile
+2-1mlir/docs/Tokens.md
+2-11 files

LLVM/project fc3e151mlir/include/mlir/IR BuiltinOps.td

drop unrealized_conversion_cast change
DeltaFile
+3-3mlir/include/mlir/IR/BuiltinOps.td
+3-31 files

LLVM/project 69f9322mlir/docs Tokens.md LangRef.md

move structural contract to LangRef
DeltaFile
+20-40mlir/docs/Tokens.md
+27-6mlir/docs/LangRef.md
+47-462 files

LLVM/project 972be7emlir/docs Tokens.md

call out IsolatedFromAbove restriction
DeltaFile
+4-0mlir/docs/Tokens.md
+4-01 files

LLVM/project 95d4e8dmlir/test/Dialect/Builtin/Bytecode builtin_fixed_0.mlirbc

regenerate bytecode
DeltaFile
+0-0mlir/test/Dialect/Builtin/Bytecode/builtin_fixed_0.mlirbc
+0-01 files

LLVM/project 183f61amlir/include/mlir/Dialect/LLVMIR LLVMIntrinsicOps.td LLVMOps.td, mlir/lib/Dialect/LLVMIR/IR LLVMTypeSyntax.cpp LLVMTypes.cpp

remove LLVM token type
DeltaFile
+23-37mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
+15-10mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
+11-11mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
+9-9mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
+7-7mlir/test/Target/LLVMIR/Import/intrinsic.ll
+6-7mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+71-8112 files not shown
+94-10918 files

LLVM/project 6cca037mlir/docs Tokens.md, mlir/docs/Traits _index.md

[mlir][IR] Require token producer and consumer traits

Add marker traits for operations that intentionally produce or consume the
builtin token type. The verifier now rejects token results without
TokenProducerTrait, token operands without TokenConsumerTrait, token entry
block arguments whose parent op does not produce tokens, and token block
arguments outside entry blocks.

Extend the Test dialect token ops to cover valid opt-in cases and each
verifier rejection path.

Assisted-by: Codex
DeltaFile
+100-2mlir/test/IR/token-type.mlir
+93-3mlir/lib/IR/Verifier.cpp
+28-3mlir/test/lib/Dialect/Test/TestOps.td
+14-7mlir/docs/Tokens.md
+14-0mlir/docs/Traits/_index.md
+12-0mlir/include/mlir/IR/OpDefinition.h
+261-152 files not shown
+268-168 files

LLVM/project 50fded2mlir/docs Tokens.md

Update mlir/docs/Tokens.md

Co-authored-by: Mehdi Amini <joker.eph at gmail.com>
DeltaFile
+2-0mlir/docs/Tokens.md
+2-01 files

LLVM/project 8c7c6a9mlir/docs/Dialects LLVM.md, mlir/lib/IR Verifier.cpp

address comments
DeltaFile
+5-9mlir/lib/IR/Verifier.cpp
+1-2mlir/docs/Dialects/LLVM.md
+6-112 files

LLVM/project 8882b47mlir/docs Tokens.md

address comments
DeltaFile
+2-3mlir/docs/Tokens.md
+2-31 files

LLVM/project 4e47ed1mlir/docs Tokens.md LangRef.md

rewrite design contract
DeltaFile
+13-9mlir/docs/Tokens.md
+9-2mlir/docs/LangRef.md
+22-112 files

LLVM/project 01a0f88mlir/docs Tokens.md LangRef.md, mlir/include/mlir/IR CommonTypeConstraints.td

address comments
DeltaFile
+17-21mlir/docs/Tokens.md
+2-17mlir/test/IR/token-type.mlir
+1-8mlir/include/mlir/IR/CommonTypeConstraints.td
+0-7mlir/test/lib/Dialect/Test/TestOps.td
+2-1mlir/docs/LangRef.md
+22-545 files

LLVM/project dcd3cabmlir/docs Tokens.md, mlir/lib/Conversion/AsyncToLLVM AsyncToLLVM.cpp

[mlir][IR] Add builtin `TokenTypeInterface`

type instead of type interface

add bytecode
DeltaFile
+104-0mlir/docs/Tokens.md
+36-24mlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
+60-0mlir/test/IR/token-type.mlir
+18-17mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp
+30-0mlir/test/lib/Dialect/Test/TestOps.td
+12-12mlir/test/Dialect/SparseTensor/invalid.mlir
+260-5324 files not shown
+365-9530 files

LLVM/project 3db8692mlir/lib/Dialect/Async/Transforms AsyncToAsyncRuntime.cpp, mlir/test/Dialect/Async async-to-async-runtime.mlir

[mlir][async] Lazily create the coroutine destroy-cleanup block

`setupCoroMachinery` previously emitted a `cleanupForDestroy` block
unconditionally, alongside the normal `cleanup` block. That block is
only ever used as the "destroy" successor of an `async.coro.suspend`,
so for coroutines that never suspend (e.g. an `async.func` whose body
contains no `async.await`) it ended up unreachable in the lowered CFG.

Make `cleanupForDestroy` mirror the existing `setError` pattern and
materialize it lazily via a new `setupCleanupForDestroyBlock` helper,
called only from the two places (`outlineExecuteOp` and the
`async.await` lowering) that actually wire it up. Store the coroutine
id on `CoroMachinery` so the helper can rebuild the block contents
without keeping the original `async.coro.id` op around.

Assisted-by: Opus 4.7
DeltaFile
+33-15mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
+33-0mlir/test/Dialect/Async/async-to-async-runtime.mlir
+66-152 files

LLVM/project 97e7ee2llvm/lib/ProfileData InstrProf.cpp, llvm/test/Transforms/PGOProfile indirect-call-vp-zeros.ll

[InstrProf] Do not emit metadata for zero values with zero counts (#199380)

If we have a indirect call site with a profile that has VP information
for said callsite that only contains zero values with zero counts, we
would start to emit invalid profile information after
1d146967d51ba76b8379d9e12961aa23e5745701. VP metadata in this case is at
best redundant with BFI. So we restrict metadata emission to only if we
have a sufficient number of values for the VP metadata to be valid.
DeltaFile
+16-0llvm/test/Transforms/PGOProfile/Inputs/indirect-call-vp-zeros.ll
+11-0llvm/test/Transforms/PGOProfile/indirect-call-vp-zeros.ll
+5-1llvm/lib/ProfileData/InstrProf.cpp
+32-13 files

LLVM/project 142af64mlir/docs Tokens.md

Update mlir/docs/Tokens.md

Co-authored-by: Mehdi Amini <joker.eph at gmail.com>
DeltaFile
+2-1mlir/docs/Tokens.md
+2-11 files

LLVM/project 1646898mlir/lib/Dialect/Async/Transforms AsyncToAsyncRuntime.cpp, mlir/test/Dialect/Async async-to-async-runtime.mlir

[mlir][async] Lazily create the coroutine destroy-cleanup block

`setupCoroMachinery` previously emitted a `cleanupForDestroy` block
unconditionally, alongside the normal `cleanup` block. That block is
only ever used as the "destroy" successor of an `async.coro.suspend`,
so for coroutines that never suspend (e.g. an `async.func` whose body
contains no `async.await`) it ended up unreachable in the lowered CFG.

Make `cleanupForDestroy` mirror the existing `setError` pattern and
materialize it lazily via a new `setupCleanupForDestroyBlock` helper,
called only from the two places (`outlineExecuteOp` and the
`async.await` lowering) that actually wire it up. Store the coroutine
id on `CoroMachinery` so the helper can rebuild the block contents
without keeping the original `async.coro.id` op around.

Assisted-by: Opus 4.7
DeltaFile
+33-15mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
+33-0mlir/test/Dialect/Async/async-to-async-runtime.mlir
+66-152 files

LLVM/project 1179d6dmlir/lib/Dialect/Async/Transforms AsyncToAsyncRuntime.cpp, mlir/test/Dialect/Async async-to-async-runtime.mlir

[mlir][async] Lazily create the coroutine destroy-cleanup block

`setupCoroMachinery` previously emitted a `cleanupForDestroy` block
unconditionally, alongside the normal `cleanup` block. That block is
only ever used as the "destroy" successor of an `async.coro.suspend`,
so for coroutines that never suspend (e.g. an `async.func` whose body
contains no `async.await`) it ended up unreachable in the lowered CFG.

Make `cleanupForDestroy` mirror the existing `setError` pattern and
materialize it lazily via a new `setupCleanupForDestroyBlock` helper,
called only from the two places (`outlineExecuteOp` and the
`async.await` lowering) that actually wire it up. Store the coroutine
id on `CoroMachinery` so the helper can rebuild the block contents
without keeping the original `async.coro.id` op around.

Assisted-by: Opus 4.7
DeltaFile
+37-15mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
+33-0mlir/test/Dialect/Async/async-to-async-runtime.mlir
+70-152 files