LLVM/project 809c308clang/lib/CIR/Dialect/Transforms CallConvLoweringPass.cpp, clang/test/CIR/CodeGen call-conv-lowering-x86_64-abi-compat.c call-conv-lowering-x86_64.c

[CIR] Accept fixed-width vectors in x86_64 callconv lowering

The CallConvLowering bridge rejects a vector in a parameter or return position,
so a function taking one fails the pass.  It also never reads the AVX level,
which is what decides whether a vector wider than 128 bits reaches a register.

A vector is accepted now where the classifier and clang size it the same way,
which means a whole-byte element and a power-of-two width.  Scalable vectors and
the other widths stay rejected.  The module's AVX level comes from the target
ABI name, as CodeGenModule does.  A classifier per level lets a target attribute
raise it for one function.  An ABI older than the rule pins every function back
to the module's level.  A direct call takes its callee's level, and an indirect
call the level of the function containing it.

CIRGen records target features on a definition but not on a declaration, so a
declaration carrying the attribute is classified at the module's level until
#214986 lands.

Assisted-by: Cursor / claude-opus-5
DeltaFile
+165-0clang/test/CIR/CodeGen/call-conv-lowering-x86_64-avx.c
+131-33clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
+77-0clang/test/CIR/CodeGen/call-conv-lowering-x86_64.c
+69-6clang/test/CIR/Transforms/abi-lowering/x86_64-vector.cir
+43-28clang/test/CIR/Transforms/abi-lowering/x86_64-variadic-call.cir
+56-6clang/test/CIR/CodeGen/call-conv-lowering-x86_64-abi-compat.c
+541-734 files not shown
+615-8110 files

LLVM/project be93e05llvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/CodeGen/RISCV sincos-expansion.ll llvm.sincos.ll

RuntimeLibcalls: Add sincos to the RISCV runtime libcall set

Inspection of the glibc sources suggests this is generically
available, with the target variance being for long double support.
The set of library functions is a large historical mess I'm attempting
to untangle. The traditional system had a large set of defaulted calls,
but sincos was a case which was explicitly enabled, and I'm assuming
riscv just never got around to adding it. It will be easier to
reorganize the library functions if synthetic architectural glibc
variance is eliminated.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+136-0llvm/test/CodeGen/RISCV/llvm.sincos.ll
+16-24llvm/test/CodeGen/RISCV/sincos-expansion.ll
+1-0llvm/include/llvm/IR/RuntimeLibcalls.td
+153-243 files

LLVM/project 7c5c130clang/lib/AST/ByteCode DynamicAllocator.cpp

[clang][bytecode][NFC] Remove an unused include (#215113)
DeltaFile
+0-1clang/lib/AST/ByteCode/DynamicAllocator.cpp
+0-11 files

LLVM/project 2776745clang/test/CodeGen kcfi-hash.c, clang/test/Driver fsanitize-cfi.c

[Driver][KCFI] Do not invoke cc1 in Driver tests (#215072)

Fixes commit a44318b125ff to avoid using cc1 in Driver tests. Moves
argument validation to CodeGen, and always uses -### for Driver tests.

Build tested on x86_64-only and aarch64-only.
DeltaFile
+6-9clang/test/Driver/fsanitize-cfi.c
+6-0clang/test/CodeGen/kcfi-hash.c
+12-92 files

LLVM/project 5dbc0eellvm/include/llvm/Transforms/Utils Local.h, llvm/lib/Transforms/Scalar SimplifyCFGPass.cpp

[SimplifyCFG] Avoid scanning functions multiple times in `removeUnreachableBlocks` (#213416)

`markAliveBlocks` scans instructions first to convert unreachable
instructions into `unreachable`, then marks alive successors. When
`iterativelySimplifyCFG` makes some changes, `removeUnreachableBlocks`
will be called again and scan the whole function again, even if
`iterativelySimplifyCFG` is unlikely to introduce new interesting
patterns.

This patch adds a new option `SimplifyInsts` to
`removeUnreachableBlocks`. When it is disabled, `markAliveBlocks` only
performs a BFS traversal.
Although it is possible to cause regressions
(unreachable-multi-basic-block-funclet.ll), it doesn't affect the
optimization result in practice:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/877

Compile-time improvement (approx -0.05%):
https://llvm-compile-time-tracker.com/compare.php?from=6a898832ff382b1a288f9eb3bc5cd1f37d0fc29f&to=565856d52880ed13c697e921f498dc400bb76c17&stat=instructions:u
DeltaFile
+165-156llvm/lib/Transforms/Utils/Local.cpp
+9-2llvm/test/Transforms/SimplifyCFG/unreachable-multi-basic-block-funclet.ll
+6-2llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+5-2llvm/include/llvm/Transforms/Utils/Local.h
+185-1624 files

LLVM/project 9fe5ab9clang/lib/StaticAnalyzer/Checkers DanglingPtrDeref.cpp

[analyzer] Add aggregate lifetime source binding to DanglingPtrDeref
DeltaFile
+8-0clang/lib/StaticAnalyzer/Checkers/DanglingPtrDeref.cpp
+8-01 files

LLVM/project b7cc8daclang/lib/StaticAnalyzer/Checkers LifetimeModeling.cpp, clang/test/Analysis lifetime-bound.cpp

[analyzer] Only bind aggregate lifetime sources in LifetimeModeling for annotated functions
DeltaFile
+32-0clang/test/Analysis/lifetime-bound.cpp
+17-4clang/lib/StaticAnalyzer/Checkers/LifetimeModeling.cpp
+49-42 files

LLVM/project 963e51bclang/include/clang/CIR/Dialect/IR CIRTypes.td CIRTypesDetails.h, clang/lib/CIR/Dialect/IR CIRTypes.cpp

[CIR] Let a record type mark what each member holds

A struct's `padded` bool only says that padding exists somewhere in the record.
It cannot say which member, and it cannot tell compiler-inserted padding from
storage the source declared that holds no ABI data, such as an unnamed
bit-field unit.  Those two need to differ, because padding is reusable tail
padding and declared storage is not, so they give different data sizes.

Give each member a mark instead: unmarked for source data, `pad`, or `empty`.
A record is then empty for the ABI when no member holds data, which
`allMembersNonData` reads off the type.

This is the first of three PRs, and nothing populates the marks yet, so
`padded` stays for now.  Retiring it before CIRGen fills the marks in would
make every struct claim it has no padding, and the x86_64 classifier would
start counting padding arrays as data with no diagnostic.  The CIRGen PR comes
next, then the bool removal PR.

Assisted-by: Cursor / claude-opus-5
DeltaFile
+148-30clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+169-0clang/unittests/CIR/RecordMemberKindTest.cpp
+66-31clang/include/clang/CIR/Dialect/IR/CIRTypesDetails.h
+72-15clang/include/clang/CIR/Dialect/IR/CIRTypes.td
+57-2clang/test/CIR/IR/struct.cir
+41-0clang/test/CIR/IR/invalid-record-member-kinds.cir
+553-782 files not shown
+570-798 files

LLVM/project 24bf85aclang/lib/StaticAnalyzer/Checkers LifetimeModeling.cpp

Add FIXME for array aggregates.
DeltaFile
+3-2clang/lib/StaticAnalyzer/Checkers/LifetimeModeling.cpp
+3-21 files

LLVM/project d68740eclang/docs ClangFormatStyleOptions.rst ClangFormatStyleOptions.md, llvm/test/Analysis/CostModel/AArch64 load_store.ll

Rebase

Created using spr 1.3.7
DeltaFile
+8,221-0clang/docs/ClangFormatStyleOptions.md
+0-8,043clang/docs/ClangFormatStyleOptions.rst
+3,980-3,687llvm/test/CodeGen/AMDGPU/llvm.amdgcn.permlane.ll
+1,619-1,619llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce-dot-product.ll
+2,999-0llvm/test/Analysis/CostModel/AArch64/load_store.ll
+1,459-966llvm/test/CodeGen/AMDGPU/dagcombine-fmul-sel.ll
+18,278-14,3153,927 files not shown
+170,132-93,3243,933 files

LLVM/project 7078915llvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination shl.ll

[ConstraintElim] Avoid int64_t{1} << 63 when decomposing SHL. (#215058)

int64_t{1} << 63 is defined as INT64_MIN on C++20 and later. In C++17
and earlier, most implementations also already implement this as
INT64_MIN, and UBSan in Clang does not flag it as UB.

Bail out if the shift amount is >= 63, as we would incorrectly add a
negative coefficient to an unsigned constraint.

PR: https://github.com/llvm/llvm-project/pull/215058
DeltaFile
+51-0llvm/test/Transforms/ConstraintElimination/shl.ll
+3-1llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+54-12 files

LLVM/project 8825ce4libcxx/docs/Status Cxx26Issues.csv, libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance iterator_sentinel.pass.cpp

[libc++][ranges] Mark LWG4242 as Resolved (#211568)

Closes https://github.com/llvm/llvm-project/issues/148224

The current implementation for the `ranges::distance(I&& first, S last)`
overload already sidesteps the `volatile first` with condition
`sized_sentinel_for<_Sp, __remove_cvref_t<_Ip>>`.

In the commit initially implementing `ranges::distance`
(c965d5448ecdf9a5513983862a78a2ba8f7fbab8), the condition was
`sized_sentinel_for<_Sp, __uncvref_t<_Ip>>` and `__uncvref_t` was just
renamed to `__remove_cvref_t` later. Also, given the overload has been
constrained with `sized_sentinel_for<_Sp, decay_t<_Ip>>`, the condition
always gives the same results as `!is_array_v<remove_reference_t<_Ip>>`
that is indicated by the resolution of LWG4242. So it can be considered
that LWG4242 was implemented in libc++ in LLVM 14.

This commit marks LWG4242 as Resolved and organises the test suite to
better represent both LWG3664 and LWG4242 tests in

    [6 lines not shown]
DeltaFile
+40-23libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.distance/iterator_sentinel.pass.cpp
+1-1libcxx/docs/Status/Cxx26Issues.csv
+41-242 files

LLVM/project 9f7e2a3llvm/test/CodeGen/X86 avx512bf16-intrinsics.ll avx512bf16-vl-intrinsics.ll

[X86] Add test coverage for #214676 (#215107)
DeltaFile
+33-0llvm/test/CodeGen/X86/avx512bf16-vl-intrinsics.ll
+16-0llvm/test/CodeGen/X86/avx512bf16-intrinsics.ll
+49-02 files

LLVM/project c4a3c97clang/lib/AST/ByteCode Function.h Interp.cpp, clang/test/AST/ByteCode invalid.cpp

[clang][bytecode] Handle invalid lambda static invokers better (#215091)

Instead of marking it as valid, mark it as constexpr, which means it
won't be valid unless it actually has valid code attached.
DeltaFile
+6-0clang/test/AST/ByteCode/invalid.cpp
+3-2clang/lib/AST/ByteCode/Function.cpp
+0-4clang/lib/AST/ByteCode/Interp.cpp
+1-1clang/lib/AST/ByteCode/Function.h
+10-74 files

LLVM/project f3aa3fbllvm/lib/Transforms/InstCombine InstCombineMulDivRem.cpp, llvm/test/Transforms/InstCombine div.ll

[InstCombine] Fold consecutive udivs into a single udiv (#214541)

Extend the existing `(X / C1) / C2 -> X / (C1 * C2)` fold to variable
divisors:

    (X udiv Y) udiv Z -> X udiv (Y * Z)   if Y * Z does not overflow

Uses willNotOverflowUnsignedMul to prove the product doesn't wrap.
Instruction count is unchanged but a division becomes a multiplication,
similar to the existing cttz-based udiv->lshr fold in visitUDiv.

One-use on the inner div, since otherwise we'd add a mul without
removing
the div. exact only propagates when both divides are exact.

Alive2: https://alive2.llvm.org/ce/z/qV6UJH

Fixes #132908
DeltaFile
+96-0llvm/test/Transforms/InstCombine/div.ll
+14-0llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+110-02 files

LLVM/project cd40fd7clang/lib/AST/ByteCode Interp.cpp

[clang][bytecode] Use PtrView in finishGlobalRecurse() (#215088)

So we create fewer Pointer instances.
DeltaFile
+7-8clang/lib/AST/ByteCode/Interp.cpp
+7-81 files

LLVM/project 273eb20mlir/include/mlir/Dialect/Vector/Transforms VectorRewritePatterns.h

[mlir] Remove dead declarations in VectorRewritePatterns.h (#215083)

rewriteBitCastOfTruncI and rewriteExtOfBitCast were introduced on
September 18, 2023 in commits bf7c490ab73a22620c3d7790c09bfb11b669e51b
and 04ba475e85cb97e9006a130855b76479b5149f47, respectively, without
corresponding function definitions.
DeltaFile
+0-15mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
+0-151 files

LLVM/project 78e17e7mlir/lib/Dialect/Arith/IR ArithOps.cpp

[mlir][arith][NFC] Make AtomicRMWKind switches exhaustive (#214622)

`getIdentityValueAttr` and `getReductionOp` in `ArithOps.cpp` each
handle 15 of
the 16 `AtomicRMWKind` cases and route the rest through a `default:`
label
carrying `// TODO: Add remaining reduction operations.`

That TODO cannot be completed. The only unhandled kind is `assign`,
which is
not a reduction: it has no identity element (`assign(x, e) = e`, so no
constant
`e` satisfies `assign(x, e) = x`) and no corresponding binary `arith`
op. It is
still a perfectly valid kind elsewhere — `memref.atomic_rmw` lowers it
to an
atomic `xchg` in `MemRefToLLVM.cpp` — it simply has no meaning for these
two
reduction helpers.

    [39 lines not shown]
DeltaFile
+6-6mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+6-61 files

LLVM/project 7c78d38llvm/lib/Target/AMDGPU/Disassembler AMDGPUDisassembler.cpp

Apply suggestion from @shiltian
DeltaFile
+1-1llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+1-11 files

LLVM/project 6c02dacllvm/lib/Target/AMDGPU/Disassembler AMDGPUDisassembler.cpp

Apply suggestion from @shiltian
DeltaFile
+1-1llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+1-11 files

LLVM/project 20e75d4llvm/lib/Transforms/Vectorize VPlanConstruction.cpp, llvm/test/Transforms/LoopVectorize first-order-recurrence-chains.ll

[VPlan] Verify hoist point when hoisting previous value of a recurrence. (#215084)

tryToSinkOrHoistRecurrenceUsers processes the fixed-order recurrences of
a loop one at a time and updates the plan for each of them. Once the
plan has been updated for one recurrence, the properties
hoistPreviousBeforeFORUsers relies on may no longer hold for the
recurrences processed later

Convert dominance assertion that does not hold in all cases (added test
cases) to a bail out, to a crash on the added test.

PR: https://github.com/llvm/llvm-project/pull/215084
DeltaFile
+222-0llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll
+15-7llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+237-72 files

LLVM/project 3b0bb10llvm/lib/Target/AMDGPU/Disassembler AMDGPUDisassembler.cpp, llvm/test/MC/Disassembler/AMDGPU decode-err.txt

[AMDGPU][MC] Return fail when the decoding is not an VGPR

Fixes #215000.
DeltaFile
+13-0llvm/test/MC/Disassembler/AMDGPU/decode-err.txt
+2-1llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+15-12 files

LLVM/project 6b7830cllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPCompatibilityAnalysis.h SLPCompatibilityAnalysis.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+219-89llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+59-0llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.cpp
+6-17llvm/test/Transforms/SLPVectorizer/vectorize-reorder-alt-shuffle.ll
+13-0llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.h
+1-11llvm/test/Transforms/SLPVectorizer/X86/BinOpSameOpcodeHelper.ll
+4-7llvm/test/Transforms/SLPVectorizer/X86/supernode.ll
+302-1246 files

LLVM/project 0815853llvm/lib/Target/AMDGPU/Disassembler AMDGPUDisassembler.cpp, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.cpp AMDGPUBaseInfo.h

[AMDGPU][MC] Check availability of certain registers (#214973)

Fixes #214952.
DeltaFile
+33-26llvm/test/MC/AMDGPU/literals.s
+40-11llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+30-0llvm/test/MC/Disassembler/AMDGPU/decode-err.txt
+14-1llvm/test/MC/AMDGPU/gfx1250_asm_operands.s
+6-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+5-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+128-381 files not shown
+130-397 files

LLVM/project a132a22llvm/include/llvm/ExecutionEngine/Orc CallableTraitsHelper.h, llvm/unittests/ExecutionEngine/Orc CMakeLists.txt CallableTraitsHelperTest.cpp

[ORC] Remove CallableTraitsHelper (#215089)

CallableTraitsHelper was only used by CallViaEPC.h / CallSPSViaEPC.h,
which were removed in the previous commit. With those gone it has no
remaining users, so remove it and its unit test.
DeltaFile
+0-74llvm/include/llvm/ExecutionEngine/Orc/CallableTraitsHelper.h
+0-70llvm/unittests/ExecutionEngine/Orc/CallableTraitsHelperTest.cpp
+0-1llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
+0-1llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
+0-1464 files

LLVM/project c3278d5clang-tools-extra/clang-tidy ClangTidyModuleRegistry.h, clang-tools-extra/docs ReleaseNotes.md

[clang-tidy] Remove deprecated `ClangTidyModuleRegistry.h` (#215055)

Close #173414.
DeltaFile
+0-21clang-tools-extra/clang-tidy/ClangTidyModuleRegistry.h
+4-0clang-tools-extra/docs/ReleaseNotes.md
+4-212 files

LLVM/project 7e0a4eellvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/RISCV spillcost-loop-invariant-gather.ll

[SLP]Charge spill cost for loop-invariant gathers live over a call

Loop-invariant gathers hoisted to the preheader by
optimizeGatherSequence are live across calls in the loop body and need
spill/reload on targets with call-clobbered vector registers, but were
skipped by getSpillCost. Charge them like other call-crossing values.

Fixes #214555

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/215093
DeltaFile
+14-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+9-5llvm/test/Transforms/SLPVectorizer/RISCV/spillcost-loop-invariant-gather.ll
+23-62 files

LLVM/project 6860517llvm/test/Transforms/SLPVectorizer/RISCV spillcost-loop-invariant-gather.ll

[SLP][NFC]Add a test with the spills for loop invariants, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/215092
DeltaFile
+79-0llvm/test/Transforms/SLPVectorizer/RISCV/spillcost-loop-invariant-gather.ll
+79-01 files

LLVM/project 0311761llvm/test/CodeGen/ARM vector-lrint.ll, llvm/test/CodeGen/X86 vector-llrint.ll fp128-libcalls-strict-gnu.ll

RuntimeLibcalls: Fix reporting incorrectly typed fp128 long double functions

l-suffixed long double math functions are fp128 only when the target's
long double is fp128. The default set provided them on every target that was
not x87 or ppc_fp128, so targets using double as long double wrongly reported
the fp128 l-suffixed functions.

Update tests that were reliant on phantom fp128 calls. These are only available
with glibc on select targets. In cases where the target supports the calls in
some triple, split the tests. In cases where the target has no fp128 library
support, delete the tests.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+21-3,157llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
+5-2,046llvm/test/CodeGen/X86/fp128-libcalls.ll
+0-1,547llvm/test/CodeGen/X86/vector-lrint.ll
+1,283-0llvm/test/CodeGen/X86/fp128-libcalls-strict-gnu.ll
+0-1,205llvm/test/CodeGen/ARM/vector-lrint.ll
+0-868llvm/test/CodeGen/X86/vector-llrint.ll
+1,309-8,82347 files not shown
+2,503-12,08353 files

LLVM/project 1a08c40llvm/include/llvm/ExecutionEngine/Orc CallSPSViaEPC.h CallViaEPC.h, llvm/unittests/ExecutionEngine/Orc CMakeLists.txt CallSPSViaEPCTest.cpp

[ORC] Remove CallViaEPC.h and CallSPSViaEPC.h (#215086)

These provided EPC calls with pluggable serialization (EPCCaller /
EPCCall / SPSEPCCaller / SPSEPCCall). That role is now filled by the
RTBridge Proxy APIs (rt::Proxy + rt::sps::ProxySpec), and these headers
had no users other than their own unit test, so remove them along with
CallSPSViaEPCTest.
DeltaFile
+0-173llvm/unittests/ExecutionEngine/Orc/CallSPSViaEPCTest.cpp
+0-153llvm/include/llvm/ExecutionEngine/Orc/CallViaEPC.h
+0-95llvm/include/llvm/ExecutionEngine/Orc/CallSPSViaEPC.h
+0-1llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
+0-1llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
+0-4235 files