LLVM/project 73f6707 — llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp, llvm/test/CodeGen/X86 atomic-rm-bit-test.ll

fix(SelectionDAG): isolate retry known bits

The LHS demanded-bits query already excludes bits masked by the RHS.
Its returned facts cannot safely reduce the RHS demand in turn.

Query LHS known bits independently, and preserve the original RHS facts
when a reduced-demand retry does not simplify. Defer the retry until
existing folds fail and skip constant or shared RHS operands.

Refresh the affected X86 atomic codegen checks.

Refs #230700
DeltaFile
+79-93llvm/test/CodeGen/X86/atomic-rm-bit-test.ll
+32-18llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+111-1112 files

LLVM/project b1dd93c — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPUtils.cpp

[SLP]Fix assert on gather of out-of-bounds extract

Failed shuffle checks left a partial mask that adjustExtracts still
consumed. Lanes absent from the mask (out-of-bounds, poison, undef
index) also widened the shuffle, so valid two-vector gathers were
rejected.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/230847
DeltaFile
+55-16llvm/test/Transforms/SLPVectorizer/X86/gather-extracts-different-vector-sizes.ll
+16-15llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPUtils.cpp
+2-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+73-323 files

LLVM/project 7fb207a — clang/lib/CodeGen CGCall.cpp, clang/test/CodeGen call-graph-section-virtual-dtor.cpp

[clang][CodeGen] Emit callee_type metadata for all indirect calls

CodeGenFunction::EmitCall only attached the call graph section callee_type
metadata to an indirect call when its caller asked for the emitted call
instruction through the callOrInvoke out parameter, because the emission
was nested in the block that stores it. Indirect calls emitted by callers
that do not pass callOrInvoke, such as the virtual destructor call of a
delete expression (emitVirtualObjectDelete -> EmitCXXDestructorCall), got
no callee_type metadata and therefore no indirect callee type identifiers
in the .llvm.callgraph section, so the call graph missed those edges.

Attach the metadata to the emitted call instruction regardless of whether
the caller asked for it.

Stacked on #230831.

Assisted-by: Claude

DeltaFile
+67-69clang/lib/CodeGen/CGCall.cpp
+32-0clang/test/CodeGen/call-graph-section-virtual-dtor.cpp
+99-692 files

LLVM/project c120a7d — clang/lib/CodeGen CGCall.cpp CodeGenModule.h, clang/test/CodeGen call-graph-section-covariant-return.cpp

[clang][CodeGen] Identify virtual methods by their override chain root in the call graph section

A virtual call site is typed after the method named at the call site, but it
can reach any overrider of that method, and overriders may differ from it in
their covariant return type. In that case the `!callee_type` identifier of a
call through a base class pointer did not match the `!callgraph` identifier
of the overrider, and the call graph section missed the edge.

Identify every method of an override chain, at definitions, call sites and
thunks, by the type of the method that introduced the virtual function, so
that virtual calls through a pointer to any class of the hierarchy match the
overriders they can reach.

Stacked on #230838.

Assisted-by: Claude
DeltaFile
+87-0clang/test/CodeGen/call-graph-section-covariant-return.cpp
+24-1clang/lib/CodeGen/CodeGenModule.cpp
+9-0clang/lib/CodeGen/CGVTables.cpp
+8-0clang/lib/CodeGen/CodeGenModule.h
+3-1clang/lib/CodeGen/CGCall.cpp
+131-25 files

LLVM/project 1e4099a — clang/lib/CodeGen CodeGenModule.cpp, clang/test/CodeGen call-graph-section-single-type-id.c

[clang][CodeGen] Attach a single callgraph type identifier to function definitions

A function definition is annotated with its call graph section type
identifier twice, when its declaration is created (SetFunctionAttributes)
and when its body is emitted (SetLLVMFunctionAttributesForDefinition), so
every defined function carries two identical `!callgraph` attachments:

    define void @foo() #0 !callgraph !3 !callgraph !3 {

Replace the attachment instead of adding a second one, so that a function
carries exactly one identifier. The `.llvm.callgraph` section is unaffected,
the AsmPrinter only uses the first identifier of a function.

Assisted-by: Claude
DeltaFile
+21-0clang/test/CodeGen/call-graph-section-single-type-id.c
+6-3clang/lib/CodeGen/CodeGenModule.cpp
+27-32 files

LLVM/project 8f7818a — libc/src/__support/math log2f.h

[libc][math] Speed up log2f subnormal normalization (#223718)

## Summary

Normalize positive subnormal inputs in `log2f` by converting the integer
significand to float exactly and accounting for the `2^-149` scale.
This replaces the existing floating-point multiplication by `2^23`.

Replacement prepared on main at
`681b57195f495c346c1d15229334bb0ffcbba957`.
The remaining diff changes only `libc/src/__support/math/log2f.h`.

The `log10f` table relocation is already covered upstream by #229173,
merged as `636bedc3b3c00266a95f139c4b79cb8b940c1a36`. It moved `LOG10_R`
and `LOG10_2` to namespace-scope inline constexpr storage. This update
preserves that implementation and drops our redundant table change,
leaving only the `log2f` subnormal optimization.

## Validation

    [21 lines not shown]
DeltaFile
+4-4libc/src/__support/math/log2f.h
+4-41 files

LLVM/project d5178df — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 split-node-reduction-resize.ll

[SLP]Fix crash on gather reduction root cast cost

Do not use gather nodes for cast context evaluation to prevent a crash.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/230836
DeltaFile
+42-0llvm/test/Transforms/SLPVectorizer/X86/split-node-reduction-resize.ll
+3-3llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+45-32 files

LLVM/project 8cd8044 — clang/lib/CodeGen CGCall.cpp, clang/test/CodeGen call-graph-section-virtual-dtor.cpp

[clang][CodeGen] Emit callee_type metadata for all indirect calls

CodeGenFunction::EmitCall only attached the call graph section callee_type
metadata to an indirect call when its caller asked for the emitted call
instruction through the callOrInvoke out parameter, because the emission
was nested in the block that stores it. Indirect calls emitted by callers
that do not pass callOrInvoke, such as the virtual destructor call of a
delete expression (emitVirtualObjectDelete -> EmitCXXDestructorCall), got
no callee_type metadata and therefore no indirect callee type identifiers
in the .llvm.callgraph section, so the call graph missed those edges.

Attach the metadata to the emitted call instruction regardless of whether
the caller asked for it.

Stacked on #230831.

Assisted-by: Claude

DeltaFile
+67-69clang/lib/CodeGen/CGCall.cpp
+32-0clang/test/CodeGen/call-graph-section-virtual-dtor.cpp
+99-692 files

LLVM/project c2c1bf3 — clang/lib/CodeGen CGCall.cpp CodeGenModule.h, clang/test/CodeGen call-graph-section-covariant-return.cpp

[clang][CodeGen] Identify virtual methods by their override chain root in the call graph section

A virtual call site is typed after the method named at the call site, but it
can reach any overrider of that method, and overriders may differ from it in
their covariant return type. In that case the `!callee_type` identifier of a
call through a base class pointer did not match the `!callgraph` identifier
of the overrider, and the call graph section missed the edge.

Identify every method of an override chain, at definitions, call sites and
thunks, by the type of the method that introduced the virtual function, so
that virtual calls through a pointer to any class of the hierarchy match the
overriders they can reach. While here, attach `!callgraph` with `setMetadata`
so that a function carries exactly one identifier.

Assisted-by: Claude
DeltaFile
+87-0clang/test/CodeGen/call-graph-section-covariant-return.cpp
+29-4clang/lib/CodeGen/CodeGenModule.cpp
+8-0clang/lib/CodeGen/CodeGenModule.h
+8-0clang/lib/CodeGen/CGVTables.cpp
+3-1clang/lib/CodeGen/CGCall.cpp
+135-55 files

LLVM/project deb983a — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 negated-lane-wrap-flags.ll

[SLP]Drop wrap flags for negated lanes with constant expressions

Only ConstantInt operands are negated, so drop nsw/nuw on
a non-constant-int constants.

Follow-up to #230453.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/230835
DeltaFile
+3-3llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+1-1llvm/test/Transforms/SLPVectorizer/X86/negated-lane-wrap-flags.ll
+4-42 files

LLVM/project a35842d — llvm/test/Transforms/SLPVectorizer/X86 negated-lane-wrap-flags.ll

[SLP][NFC]Add a test missing incorrect nsw propagation on constexprs, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/230834
DeltaFile
+46-0llvm/test/Transforms/SLPVectorizer/X86/negated-lane-wrap-flags.ll
+46-01 files

LLVM/project d987f8b — clang/lib/CodeGen CGCall.cpp, clang/test/CodeGen call-graph-section-virtual-dtor.cpp

[clang][CodeGen] Emit callee_type metadata for all indirect calls

CodeGenFunction::EmitCall only attached the call graph section callee_type
metadata to an indirect call when its caller asked for the emitted call
instruction through the callOrInvoke out parameter, because the emission
was nested in the block that stores it. Indirect calls emitted by callers
that do not pass callOrInvoke, such as the virtual destructor call of a
delete expression (emitVirtualObjectDelete -> EmitCXXDestructorCall), got
no callee_type metadata and therefore no indirect callee type identifiers
in the .llvm.callgraph section, so the call graph missed those edges.

Attach the metadata to the emitted call instruction regardless of whether
the caller asked for it.

Stacked on #230831.

Assisted-by: Claude
DeltaFile
+67-69clang/lib/CodeGen/CGCall.cpp
+32-0clang/test/CodeGen/call-graph-section-virtual-dtor.cpp
+99-692 files

LLVM/project a27e882 — clang/lib/CodeGen CGCall.cpp CodeGenModule.h, clang/test/CodeGen call-graph-section-covariant-return.cpp

[clang][CodeGen] Identify virtual methods by their override chain root in the call graph section

A virtual call site is annotated with the type of the method named at the
call site (e.g. `Base::clone` for `b->clone()` with `b` of type `Base *`),
but it can reach any overrider of that method. Overriders may differ from
the overridden method only in their covariant return type, in which case
their call graph section type identifier (`!callgraph`) did not match the
type identifier of the call site (`!callee_type`), so the call graph
missed the edge: `Derived *Derived::clone()` was identified as
`_ZTSFP7DerivedvE`, while calls through `Base *` were typed
`_ZTSFP4BasevE`.

Identify every method of an override chain, at the definition and at the
call site, by the type of the method that introduced the virtual function
(the root of the override chain), so that virtual calls through a pointer
to any class of the hierarchy match the overriders they can reach. A
method that overrides several virtual functions with different covariant
return types is identified after the first one; the return adjusting
thunks that fill the vtable slots created by the other overridden methods

    [14 lines not shown]
DeltaFile
+87-0clang/test/CodeGen/call-graph-section-covariant-return.cpp
+29-4clang/lib/CodeGen/CodeGenModule.cpp
+8-0clang/lib/CodeGen/CodeGenModule.h
+8-0clang/lib/CodeGen/CGVTables.cpp
+3-1clang/lib/CodeGen/CGCall.cpp
+135-55 files

LLVM/project a3da945 — llvm/test/tools/llubi bitinsert_bitextract_le.ll bitinsert_bitextract_be.ll, llvm/tools/llubi/lib Context.h Context.cpp

[llubi] Add support for `bitinsert` and `bitextract`
DeltaFile
+78-0llvm/test/tools/llubi/bitinsert_bitextract_le.ll
+78-0llvm/test/tools/llubi/bitinsert_bitextract_be.ll
+29-0llvm/tools/llubi/lib/Interpreter.cpp
+19-0llvm/tools/llubi/lib/Context.cpp
+7-0llvm/tools/llubi/lib/Context.h
+211-05 files

LLVM/project 46cf0b8 — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/PhaseOrdering/AArch64 reassociate-fma-pairs.ll

[SLP]Count splats as single broadcast for in-loop trees

The loop-aware instruction-count check scaled the per-lane count of
splat gather entries by the trip count, rejecting profitable trees.
A splat is a single broadcast regardless of the loop scale. Fixes
4-6% RAJAPerf Apps_DIFFUSION3DPA regression on AArch64 introduced
by #211096.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/230821
DeltaFile
+20-29llvm/test/Transforms/SLPVectorizer/AArch64/loop-splat-inst-count.ll
+23-26llvm/test/Transforms/PhaseOrdering/AArch64/reassociate-fma-pairs.ll
+13-9llvm/test/Transforms/SLPVectorizer/AArch64/splat-gather-subtree-store-chain.ll
+3-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+59-664 files

LLVM/project cb2526b — llvm/test/Transforms/InstCombine bitinsert-bitextract.ll

[InstCombine] Pre-commit tests for full-width `bitinsert`/`bitextract`
DeltaFile
+152-0llvm/test/Transforms/InstCombine/bitinsert-bitextract.ll
+152-01 files

LLVM/project 36f85bd — llvm/lib/Transforms/InstCombine InstCombineInternal.h InstructionCombining.cpp, llvm/test/Transforms/InstCombine bitinsert-bitextract.ll

[InstCombine] Fold full-width `bitinsert` and `bitextract` to `bitcast`
DeltaFile
+31-0llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+8-10llvm/test/Transforms/InstCombine/bitinsert-bitextract.ll
+2-0llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+41-103 files

LLVM/project 312a314 — llvm/lib/Analysis InstructionSimplify.cpp

Fix CI
DeltaFile
+2-2llvm/lib/Analysis/InstructionSimplify.cpp
+2-21 files

LLVM/project 84a4bdf — llvm/test/Transforms/InstSimplify bitinsert-bitextract.ll

[InstSimplify] Pre-commit tests for `bitinsert` and `bitextract`




DeltaFile
+331-0llvm/test/Transforms/InstSimplify/bitinsert-bitextract.ll
+331-01 files

LLVM/project cb94203 — llvm/lib/Analysis InstructionSimplify.cpp

[InstSimplify] Use `m_ConstantInt` for bit range offset
DeltaFile
+3-3llvm/lib/Analysis/InstructionSimplify.cpp
+3-31 files

LLVM/project fa46740 — llvm/include/llvm/Analysis InstSimplifyFolder.h InstructionSimplify.h, llvm/include/llvm/IR PatternMatch.h

[InstSimplify] Simplify `bitinsert` and `bitextract`
DeltaFile
+89-0llvm/lib/Analysis/InstructionSimplify.cpp
+18-43llvm/test/Transforms/InstSimplify/bitinsert-bitextract.ll
+29-0llvm/unittests/IR/PatternMatch.cpp
+15-0llvm/include/llvm/IR/PatternMatch.h
+8-0llvm/include/llvm/Analysis/InstructionSimplify.h
+2-4llvm/include/llvm/Analysis/InstSimplifyFolder.h
+161-476 files

LLVM/project 82223dd — llvm/lib/Analysis InstructionSimplify.cpp, llvm/test/Transforms/InstSimplify bitinsert-bitextract.ll

[InstSimplify] Fold reinsert of non-byte `bitextract`
DeltaFile
+9-19llvm/test/Transforms/InstSimplify/bitinsert-bitextract.ll
+2-6llvm/lib/Analysis/InstructionSimplify.cpp
+11-252 files

LLVM/project 8bb9f78 — llvm/lib/Transforms/Utils VNCoercion.cpp, llvm/test/Transforms/GVN byte-conversion.ll

[GVN] Don't coerce forwarded byte values through integers

DeltaFile
+46-90llvm/test/Transforms/GVN/byte-conversion.ll
+25-6llvm/lib/Transforms/Utils/VNCoercion.cpp
+71-962 files

LLVM/project f13c8f5 — llvm/test/Transforms/GVN byte-conversion.ll

[GVN] Pre-commit tests for byte conversions

DeltaFile
+278-0llvm/test/Transforms/GVN/byte-conversion.ll
+278-01 files

LLVM/project 459bce1 — llvm/include/llvm/Analysis TargetFolder.h ConstantFolding.h, llvm/include/llvm/IR ConstantFolder.h

[ConstantFolding] Fold `bitinsert` and `bitextract` (#229115)

Constant fold `bitinsert` and `bitextract`.

- Bits of a `ConstantByte` are extracted or inserted, then reinterpreted
as if by `bitcast`.
- A `bitinsert` that overwrites every bit of the base becomes a
`bitcast` of the value.
- An out-of-range, `poison` source or `poison`/`undef` offset returns
`poison`.

```llvm
%a = bitextract i8, b32 512, i32 8      ; i8 2
%b = bitinsert b32 0, i8 1, i32 8       ; b32 256
%c = bitinsert b16 0, half 1.0, i32 0   ; b16 15360, the bits of half 1.0
%d = bitextract i8, b32 0, i32 25       ; i8 poison
```
DeltaFile
+378-0llvm/test/Transforms/InstSimplify/ConstProp/bitinsert-bitextract.ll
+86-0llvm/lib/Analysis/ConstantFolding.cpp
+14-0llvm/include/llvm/Analysis/ConstantFolding.h
+9-0llvm/include/llvm/Analysis/TargetFolder.h
+2-2llvm/include/llvm/IR/ConstantFolder.h
+489-25 files

LLVM/project 29228c2 — llvm/test/tools/llubi bitinsert_bitextract_le.ll bitinsert_bitextract_be.ll, llvm/tools/llubi/lib Context.h Context.cpp

[llubi] Add support for `bitinsert` and `bitextract`
DeltaFile
+116-0llvm/test/tools/llubi/bitinsert_bitextract_le.ll
+116-0llvm/test/tools/llubi/bitinsert_bitextract_be.ll
+32-0llvm/tools/llubi/lib/Interpreter.cpp
+19-0llvm/tools/llubi/lib/Context.cpp
+7-0llvm/tools/llubi/lib/Context.h
+290-05 files

LLVM/project a341eb4 — llvm/tools/llubi/lib Context.cpp

Fix formatting
DeltaFile
+2-2llvm/tools/llubi/lib/Context.cpp
+2-21 files

LLVM/project 82e2575 — llvm/docs InstCombineContributorGuide.md

[InstCombine] fix power of two examples (#230814)
DeltaFile
+2-2llvm/docs/InstCombineContributorGuide.md
+2-21 files

LLVM/project dab20c9 — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/PhaseOrdering/AArch64 reassociate-fma-pairs.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+20-29llvm/test/Transforms/SLPVectorizer/AArch64/loop-splat-inst-count.ll
+23-26llvm/test/Transforms/PhaseOrdering/AArch64/reassociate-fma-pairs.ll
+13-9llvm/test/Transforms/SLPVectorizer/AArch64/splat-gather-subtree-store-chain.ll
+3-2llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+59-664 files

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

[bazel] Port 3d519f5eee97 (#230820)
DeltaFile
+6-0utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+6-01 files