LLVM/project a1feba6 — clang/lib/StaticAnalyzer/Core RangeConstraintManager.cpp

[analyzer] Drop the unused FoldingSetNode base of EquivalenceClass (#244866)

EquivalenceClass derived from FoldingSetNode but was never put in a
FoldingSet; its Profile method is all ImmutableMap/Set need. Drop the
base. This shrinks it from 16 to 8 bytes on 64-bit targets, and the
ClassMap, ClassMembers, ConstraintRange and DisequalityMap nodes from 80
to 72 bytes and the ClassSet nodes from 72 to 64 bytes.

Assisted-by: Claude Opus 5.5

Co-authored-by: Gabor Horvath <gaborh at apple.com>
DeltaFile
+1-1clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
+1-11 files

LLVM/project 02d22bd — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Merge dst_type_might_be_derived_from_static_type into path_dst_ptr_to_static_ptr
DeltaFile
+17-32libcxxabi/src/private_typeinfo.cpp
+1-1libcxxabi/src/private_typeinfo.h
+18-332 files

LLVM/project d4afdc5 — lldb/source/Plugins/SymbolFile/NativePDB PdbAstBuilderClang.cpp, lldb/test/Shell/SymbolFile/NativePDB local-enum.cpp

[lldb][NativePDB] Don't turn function-local enums into scoped enums (#244640)

CodeView can't tell a scoped enum from an unscoped enum.

`EnumRecord::isScoped()` was the wrong check: it does not say whether
the enum is an `enum class`. Instead, it says if the type is declared
inside the body of a function.

This patch always creates unscoped enums and adds a new test which fails
without the change.

rdar://192360576
DeltaFile
+18-0lldb/test/Shell/SymbolFile/NativePDB/local-enum.cpp
+1-1lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilderClang.cpp
+19-12 files

LLVM/project fc3b71c — clang/test/AST ast-dump-decl.cpp ast-dump-APValue-lvalue.cpp, clang/test/AST/HLSL ast-dump-APValue-matrix.hlsl

[clang][AST] Dump saved APValue of all `VarDecl`s (#239672)

Only evaluate the value of constexpr variables during `dump()`, but
always print the saved `APValue` if there is one.

This is more honest since we don't withhold the values we calculated for
non-constexpr variables.
DeltaFile
+37-37clang/test/AST/ast-dump-APValue-array.cpp
+35-35clang/test/AST/ast-dump-APValue-struct.cpp
+20-20clang/test/AST/HLSL/ast-dump-APValue-matrix.hlsl
+15-15clang/test/AST/ast-dump-APValue-vector.cpp
+11-11clang/test/AST/ast-dump-APValue-lvalue.cpp
+10-8clang/test/AST/ast-dump-decl.cpp
+128-12619 files not shown
+203-17525 files

LLVM/project 7a9e8e1 — lldb/source/Host/windows MainLoopWindows.cpp, lldb/unittests/Host MainLoopTest.cpp

[lldb][Windows] Restore blocking mode of sockets polled by MainLoopWindows (#243851)

`MainLoopWindows` polls sockets with `WSAEventSelect`, which makes them
non-blocking, and `DidPoll` never restores blocking mode.

This patch restores blocking mode in `DidPoll`, after clearing the event
selection.

Under load, at desk, `SocketTest.CreatePair` fails 49 of 6000 runs
without this patch and passes 8000 of 8000 with it. The new
`MainLoopTest.PolledSocketStaysBlocking` fails every run without it.

rdar://191149178
DeltaFile
+29-0lldb/unittests/Host/MainLoopTest.cpp
+3-0lldb/source/Host/windows/MainLoopWindows.cpp
+32-02 files

LLVM/project 14f5a3e — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Merge dst_type_might_be_derived_from_static_type into path_dst_ptr_to_static_ptr
DeltaFile
+17-26libcxxabi/src/private_typeinfo.cpp
+1-1libcxxabi/src/private_typeinfo.h
+18-272 files

LLVM/project d06e252 — clang/lib/CodeGen CGStmtOpenMP.cpp, clang/test/OpenMP atomic_no_flush_codegen.c atomic_compare_codegen.cpp

[OpenMP] Don't emit explicit flushes for atomic constructs

Clang and the OpenMPIRBuilder followed every atomic construct that has a
memory ordering other than relaxed with a call to __kmpc_flush, which is
a full memory barrier.  However the LLVM LangRef specifies that an atomic
operation itself can provide the ordering "rather than an explicit fence",
so this isn't actually necessary.

It seems the calls are emitted based on a reading of the spec describing
*implied* flushes to mean that flushes should be literally emitted;
an alternative reading (here) is that the flushes are implied by the
atomic operation itself.  See e.g. OpenMP 6.0 "17.8.5 atomic Construct"
or equivalent passages in 5.0 through 5.2.  The flushes in question
are the "with a list" type for seq_cst, i.e. relating only to the
memory locations used in the atomic.  For acquire/release atomics,
synchronization happens through the atomic's variable.

The __kmpc_flush call was also only emitted after the atomic operation,
so in some cases we're *already* relying on the ordering provided by

    [29 lines not shown]
DeltaFile
+440-1,358clang/test/OpenMP/atomic_compare_codegen.cpp
+22-88clang/lib/CodeGen/CGStmtOpenMP.cpp
+86-0clang/test/OpenMP/atomic_no_flush_codegen.c
+0-67llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+15-15mlir/test/Target/LLVMIR/openmp-llvm.mlir
+10-10flang/test/Integration/OpenMP/atomic-compare.f90
+573-1,53811 files not shown
+631-1,59617 files

LLVM/project 97cb69e — llvm/lib/Target/SPIRV SPIRVEmitIntrinsics.cpp, llvm/test/CodeGen/SPIRV/instructions select-multi-register-aggregate-arms.ll

[SPIR-V] Rebuild multi-register aggregate arms from a typed placeholder (#236369)

`insertCompositeAggregateArms` rebuilds a multi-register aggregate arm
(e.g. the result of `llvm.sincos`) of an aggregate select or PHI with
`insertvalue`, starting from `poison`. It runs after
`preprocessUndefsAndPoisons`, so that poison stayed bare and
`visitInsertValueInst` turned it into `UndefValue::get(i32)`, which is
uniqued: a second such chain in the function, or any `i32 undef`, then
got the first chain's SPIR-V type, giving an invalid
`OpCompositeInsert`. The chain now starts from the placeholder
`preprocessUndefsAndPoisons` would have created.

Assisted-by: Claude Opus 5.5

---------

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+53-0llvm/test/CodeGen/SPIRV/instructions/select-multi-register-aggregate-arms.ll
+14-2llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+67-22 files

LLVM/project 6a14adf — llvm/lib/Target/SPIRV SPIRVEmitIntrinsics.cpp, llvm/test/CodeGen/SPIRV/pointers getelementptr-byte-offset-past-element.ll

[SPIRV] Fold constant byte offsets past an array element into the index (#243461)

Logical SPIR-V asserts in `walkLogicalAccessChainConstant` when a GEP
adds a constant byte offset to a pointer into a byte-addressed array and
the offset reaches past the element. For example, InstCombine turns
`color.data[o + 2]` on `float4 data[8]` into `getelementptr [16 x i8],
%base, i32 %o` followed by `getelementptr i8, %p, i32 32`. The access
chain walk deduces `<4 x float>` for `%p` and cannot apply a 32-byte
offset to it.

This splits offsets like this into a count of array elements, which it
adds to the array index, and the leftover bytes, which stay a byte
offset inside the new element. In the example, `color.data[o]` plus 32
bytes becomes `color.data[o + 2]`. Longer GEP chains and variable
offsets still fail.

Addresses the constant-byte-offset crash in #206815.
DeltaFile
+80-0llvm/test/CodeGen/SPIRV/pointers/getelementptr-byte-offset-past-element.ll
+58-0llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+138-02 files

LLVM/project a85c33a — llvm/test/Transforms/Util/DeclareRuntimeLibcalls systemz.ll sparc.ll

RuntimeLibcalls: Add attributes to fenv libcalls (#244446)

Treat the fp environment as inaccessible memory.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+25-20llvm/test/Transforms/Util/DeclareRuntimeLibcalls/aarch64.ll
+20-16llvm/test/Transforms/Util/DeclareRuntimeLibcalls/windows.ll
+15-12llvm/test/Transforms/Util/DeclareRuntimeLibcalls/ppc.ll
+15-12llvm/test/Transforms/Util/DeclareRuntimeLibcalls/bsd.ll
+10-8llvm/test/Transforms/Util/DeclareRuntimeLibcalls/systemz.ll
+10-8llvm/test/Transforms/Util/DeclareRuntimeLibcalls/sparc.ll
+95-7610 files not shown
+171-13216 files

LLVM/project f0d8907 — llvm/lib/Transforms/IPO LowerTypeTests.cpp

comment
DeltaFile
+3-0llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+3-01 files

LLVM/project 3b0fe13 — llvm/lib/IR Module.cpp, llvm/unittests/IR ModuleTest.cpp

[IR] Fix name clashes in Module move assignment (#245152)

The global variable, function, alias, and ifunc lists share one symbol
table, but move assignment cleared and spliced them one list at a time.
An incoming value named like a destination value in a list not cleared
yet was renamed, such as an incoming global variable @foo becoming
@foo.1 next to a destination function @foo. Clear all four lists before
splicing any.

Assisted-by: Claude Code (Claude Opus 5.5)
DeltaFile
+60-0llvm/unittests/IR/ModuleTest.cpp
+6-6llvm/lib/IR/Module.cpp
+66-62 files

LLVM/project cb075a8 — llvm/lib/Target/Sparc SparcISelLowering.cpp, llvm/test/CodeGen/SPARC fp128.ll fp-strict-cmp.ll

[SPARC] Use the f128 compare helpers for matching strict compares (#244836)

With strict FP, every soft-quad f128 compare called _Q_cmp/_Qp_cmp or
_Q_cmpe/_Qp_cmpe and decoded the result. The predicate helpers have
fixed exception behaviour: _Q_flt, _Q_fle, _Q_fgt and _Q_fge (and the
_Qp_ forms) are signaling like fcmpe, and _Q_feq and _Q_fne are quiet
like fcmp. Use them when that matches the compare, as GCC does. This
covers the plain C comparison operators. The other compares still use
_Q[p]_cmp/_Q[p]_cmpe.

Fixes #244636

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+773-0llvm/test/CodeGen/SPARC/fp128-cmp.ll
+198-90llvm/test/CodeGen/SPARC/fp128-strict-cmp.ll
+103-69llvm/lib/Target/Sparc/SparcISelLowering.cpp
+20-19llvm/test/CodeGen/SPARC/fp128-strict.ll
+9-9llvm/test/CodeGen/SPARC/fp-strict-cmp.ll
+6-3llvm/test/CodeGen/SPARC/fp128.ll
+1,109-1906 files

LLVM/project cd1815e — libc/test/integration/src/unistd fork_test.cpp, libc/test/src/sched cpu_count_test.cpp CMakeLists.txt

[libc] Use the gettid syscall wrapper in tests (#244825)

This PR move gettid calls in libc tests behind the centralized syscall
wrappers, following libc/docs/dev/syscall_wrapper_refactor.md.
DeltaFile
+3-4libc/test/src/sched/affinity_test.cpp
+2-4libc/test/src/sched/linux/clone_test.cpp
+2-4libc/test/src/sched/CMakeLists.txt
+2-4libc/test/integration/src/unistd/fork_test.cpp
+2-2libc/test/src/sched/cpu_count_test.cpp
+1-2libc/test/src/sched/linux/CMakeLists.txt
+12-203 files not shown
+16-239 files

LLVM/project 92af8f8 — clang/lib/Basic/Targets RISCV.cpp, clang/lib/Sema SemaType.cpp

fixup cleanup
DeltaFile
+0-2clang/lib/Basic/Targets/RISCV.cpp
+0-1clang/lib/Sema/SemaType.cpp
+0-32 files

LLVM/project 8e213d9 — llvm/test/CodeGen/X86 pr241268.ll

[X86] Add test coverage for #241268 (#245204)
DeltaFile
+58-0llvm/test/CodeGen/X86/pr241268.ll
+58-01 files

LLVM/project 565b6e9 — llvm/include/llvm/ObjectYAML MachOYAML.h, llvm/lib/ObjectYAML MachOYAML.cpp

[ObjectYAML][MachO] Support named filetype values (#244575)

yaml2obj accepted the Mach-O `filetype` field only as a number, for
example `filetype: 0x00000002`. Support named values like `filetype:
MH_EXECUTE`, the same way as the `cmd` field of Mach-O load commands and
the `Type` field of ELF (`Type: ET_EXEC`). obj2yaml now prints the
names. Numbers still work, so existing tests don't change.
DeltaFile
+88-0llvm/test/ObjectYAML/MachO/filetype.yaml
+18-0llvm/include/llvm/ObjectYAML/MachOYAML.h
+6-1llvm/lib/ObjectYAML/MachOYAML.cpp
+2-2llvm/test/ObjectYAML/MachO/fat_macho_i386_x86_64.yaml
+1-1llvm/test/ObjectYAML/MachO/mach_header_64.yaml
+1-1llvm/test/ObjectYAML/MachO/mach_header.yaml
+116-53 files not shown
+119-89 files

LLVM/project 229f673 — mlir/lib/Dialect/UB/IR UBOps.cpp, mlir/lib/Transforms/Utils InliningUtils.cpp

[mlir][inliner] Ask the terminator dialect before the single-block fast path (#237936)

Fix a crash in the inliner when a func.func ends with llvm.unreachable
or ub.unreachable.

Before taking the single-block fast path, the inliner asked the dialect
of the callable's parent operation (func), but the terminator is then
handled by the inliner interface of its own dialect, which could not
handle the fast path:

- LLVMInlinerInterface::handleTerminator casts the terminator to
llvm.return, so llvm.unreachable failed the cast assertion (#237592).
- UBInlinerInterface does not implement handleTerminator, so
ub.unreachable hit the default llvm_unreachable (#237590).

The inliner now asks the terminator's dialect whether the fast path is
allowed. The LLVM dialect already disables it for llvm.unreachable,
which fixes #237592. The UB dialect now always disables it
(ub.unreachable is its only terminator) and implements the multi-block

    [5 lines not shown]
DeltaFile
+17-0mlir/test/Dialect/LLVMIR/inlining.mlir
+16-0mlir/test/Transforms/inlining.mlir
+12-0mlir/lib/Dialect/UB/IR/UBOps.cpp
+4-1mlir/lib/Transforms/Utils/InliningUtils.cpp
+49-14 files

LLVM/project 5d87387 — llvm/lib/Target/AMDGPU SMInstructions.td, llvm/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp

[AMDGPU] Allow instruction prefetch opcodes to use label as operands (#237968)

This patch allows the instruction prefetch opcodes to be able to specify
a label target and have the target offset computed by the assembler,
thus replacing the manual tracking and computing of the offsets.
DeltaFile
+44-0llvm/test/MC/AMDGPU/labels-branch.s
+34-0llvm/test/MC/AMDGPU/prefetch-label-errors.s
+24-0llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+22-0llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCCodeEmitter.cpp
+19-2llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp
+15-4llvm/lib/Target/AMDGPU/SMInstructions.td
+158-67 files not shown
+223-613 files

LLVM/project d4f103e — mlir/include/mlir/Dialect/SPIRV/IR SPIRVTypes.h SPIRVBase.td, mlir/lib/Dialect/SPIRV/IR SPIRVDialect.cpp SPIRVTypes.cpp

[mlir][SPIR-V] Add untyped pointer type from SPV_KHR_untyped_pointers (#242410)

First step of SPV_KHR_untyped_pointers support

Untyped variables, access chains and lowering to LLVM will follow later
DeltaFile
+47-3mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
+29-1mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
+20-0mlir/test/Dialect/SPIRV/IR/types.mlir
+15-4mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
+16-1mlir/include/mlir/Dialect/SPIRV/IR/SPIRVTypes.h
+17-0mlir/test/Target/SPIRV/untyped-pointers.mlir
+144-96 files not shown
+179-1012 files

LLVM/project e9d7fb7 — llvm/cmake/modules TableGen.cmake, mlir/cmake/modules AddMLIR.cmake

[CMake] Use depfiles with all generators (#244383)

With CMake 3.31 as the minimum required version (since #223854) the
version checks are dead
DeltaFile
+3-11mlir/cmake/modules/AddMLIR.cmake
+3-11llvm/cmake/modules/TableGen.cmake
+6-222 files

LLVM/project 2a22a47 — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Only store a single dst_ptr
DeltaFile
+12-16libcxxabi/src/private_typeinfo.cpp
+2-4libcxxabi/src/private_typeinfo.h
+14-202 files

LLVM/project eeef5a4 — clang-tools-extra/clangd/refactor/tweaks DefineOutline.cpp, clang-tools-extra/clangd/unittests/tweaks DefineOutlineTests.cpp

[clangd] Drop attributes from definitions generated by DefineOutline (#242635)

When DefineOutline moves a function body out of line, it no longer
copies the attributes to the generated definition. They stay on the
declaration, where the definition inherits them from.

Example: Applied to
```
struct A { [[nodiscard]] int foo() { return 0; } };
```
Before:
```
struct A { [[nodiscard]] int foo(); };
[[nodiscard]] int A::foo() { return 0; }
```
Now:
```
struct A { [[nodiscard]] int foo(); };
int A::foo() { return 0; }

    [22 lines not shown]
DeltaFile
+322-1clang-tools-extra/clangd/unittests/tweaks/DefineOutlineTests.cpp
+163-23clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
+4-0clang-tools-extra/docs/ReleaseNotes.md
+489-243 files

LLVM/project 4bf1058 — mlir/lib/Conversion/TosaToLinalg TosaToLinalg.cpp, mlir/test/Conversion/TosaToLinalg tosa-to-linalg.mlir

[mlir][tosa] Fix Rescale mixed constant lowering (#241992)

## Summary

Fix `tosa.rescale` lowering when exactly one of the multiplier or shift
operands is constant. Extract each constant operand’s values
independently so the lowering doesn’t create an empty tensor for the
constant input.

Add regression tests for both mixed constant/dynamic cases, covering
scalar and per-channel operands. Add an assertion to catch a constant
operand being passed to the lowering helper without values.

Fixes #238236

AI Usage Disclaimer: Copilot tool was used to generate tests in
`mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir`. I've reviewed
to the best of my ability.
DeltaFile
+55-7mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
+15-15mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
+70-222 files

LLVM/project 78b32bf — llvm/lib/Target/Mips MipsDSPInstrInfo.td, llvm/test/CodeGen/Mips dsp-vec-bitcast.ll

[Mips] Fix DSP bitcasts between v2i16 and v4i8

v2i16 and v4i8 are both legal DSP vector types in the DSPR register
class, but MipsDSPInstrInfo.td only had bitconvert patterns between each
of them and i32/f32, so a bitcast between the two vector types failed to
select.

The bitcast is a no-op: both types are loaded and stored as a 32-bit GPR
word with element 0 at the lowest address on either endianness. Add the
two missing patterns, plus a test covering both directions on both byte
orders.

Fixes #245155
DeltaFile
+66-0llvm/test/CodeGen/Mips/dsp-vec-bitcast.ll
+2-0llvm/lib/Target/Mips/MipsDSPInstrInfo.td
+68-02 files

LLVM/project b579a24 — llvm/lib/Object RelocationResolver.cpp, llvm/lib/Target/Sparc SparcTargetObjectFile.cpp

[SPARC] Use a DTP-relative offset for the DWARF location of TLS variables (#244842)

The SPARC target did not override getDebugThreadLocalSymbol, so the
DW_OP_const4u/DW_OP_const8u operand in the location of a thread-local
variable was emitted as a plain address (R_SPARC_32/R_SPARC_UA64)
instead of the variable's offset within the module's TLS block. gdb
then could not read thread-local variables in programs built with clang.

Emit %r_tls_dtpoff32/%r_tls_dtpoff64, as GCC does, which become
R_SPARC_TLS_DTPOFF32/R_SPARC_TLS_DTPOFF64. Accept these specifiers in
.word/.xword in the assembler, mark the referenced symbol STT_TLS like
GNU as, and teach the RelocationResolver about the relocations so
llvm-dwarfdump does not warn about them.

Fixes #244635

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+61-0llvm/test/DebugInfo/Sparc/tls.ll
+54-0llvm/test/MC/Sparc/Relocations/tls-dtpoff.s
+13-0llvm/lib/Target/Sparc/MCTargetDesc/SparcELFObjectWriter.cpp
+10-0llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp
+7-1llvm/lib/Object/RelocationResolver.cpp
+4-0llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp
+149-11 files not shown
+151-17 files

LLVM/project 6f3c64b — llvm/lib/Target/Sparc/AsmParser SparcAsmParser.cpp, llvm/test/MC/Sparc sparc-asm-errors.s

[Sparc][MC] Report unknown register names as invalid register names (#245150)

When the name after '%' is neither a register nor a relocation
specifier, the parser always reported "invalid relocation specifier",
even for things like "%r100" or "%f33" that were clearly meant to be
registers.

Make matchSparcAsmModifiers return ParseStatus and only treat the name
as a relocation specifier when it is followed by '('. Otherwise report
"invalid register name" in the caller, right after trying to match a
register name.

Also report an error for the TLS relocation specifiers that are only
valid as the trailing relocation operand, instead of failing without
one.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+18-15llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
+19-4llvm/test/MC/Sparc/sparc-asm-errors.s
+37-192 files

LLVM/project d32896b — llvm/lib/Transforms/Scalar ScalarOptions.td LoopInterchange.cpp, llvm/test/Transforms/LoopInterchange reduction2mem-limitation.ll reduction2mem.ll

[LoopInterchange] Hoist Safe instruction to inner loop's PreHeader (#236078)

Currently for one of motivating examples in bwaves benchmark, where
address calculation is emitted near to store in reduction loops exit
block.
To enable reduction2memory in thiscase, we need to hoist the address
calculation to inner loop pre header so it becomes available to perform
the load.
This gives 5-6% performance gain for bwaves.
DeltaFile
+91-0llvm/test/Transforms/LoopInterchange/reduction2mem.ll
+64-10llvm/test/Transforms/LoopInterchange/reduction2mem-limitation.ll
+55-11llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+2-0llvm/lib/Transforms/Scalar/ScalarOptions.td
+212-214 files

LLVM/project 7e3b0bf — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/AArch64 fast-two-sum-operand-order.ll

[SLP]Keep fast-two-sum operands in one column on reorder

Look-ahead paired b of s = a + b; e = s - b with a of the other lane,
so each product was vectorized twice plus shuffles (libc sincos on
AArch64: 4 vector fmuls instead of 2). Operands, used with the lane
root by the same binary users, stay in one column.

Assisted-by: Cursor

Pull-request: https://github.com/llvm/llvm-project/pull/243142
Reviewers: RKSimon, bababuck
Reviewed-by: bababuck
DeltaFile
+68-16llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+6-24llvm/test/Transforms/SLPVectorizer/AArch64/fast-two-sum-operand-order.ll
+7-11llvm/test/Transforms/SLPVectorizer/X86/fast-two-sum-operand-order-second-pass.ll
+81-513 files

LLVM/project 1927cff — llvm/test/CodeGen/AArch64 select-logical-op-br.ll, llvm/test/CodeGen/PowerPC select-logical-op-br.ll

[CodeGenPrepare] Add tests for selects with branch weights (NFC)

Precommit tests for #244382 (issue #236043) and for a follow-up that
uses TTI::shouldTreatInstructionLikeSelect() in optimizeSelectInst():
- logical and/or selects, most of them with branch weights and feeding a
  conditional branch in the same block;
- selects of two constants with branch weights, alone and next to other
  selects on the same condition;
- a select of two constant vectors on ARM, which does not support it.

The CodeGenPrepare tests are for x86-64 and ARM. The llc tests are for
x86-64, AArch64 (neoverse-v2, where a predictable select is expensive)
and PowerPC.

Assisted-by: Claude Code (Claude Opus 5.5)
DeltaFile
+535-0llvm/test/Transforms/CodeGenPrepare/X86/select-logical-op-br.ll
+239-0llvm/test/CodeGen/X86/cmov-into-branch.ll
+182-0llvm/test/Transforms/CodeGenPrepare/X86/select-two-constants.ll
+92-0llvm/test/CodeGen/PowerPC/select-logical-op-br.ll
+65-0llvm/test/CodeGen/AArch64/select-logical-op-br.ll
+25-0llvm/test/Transforms/CodeGenPrepare/ARM/select-vector-consts.ll
+1,138-06 files