LLVM/project 99a148b — llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp

[TargetLowering] Don't call willNotOverflowSub in expandABD for ABDU with non-negative inputs. (#237338)

If the inputs are non-negative, then the difference between them
can never overflow so we don't need to call willNotOverflowSub.
DeltaFile
+6-2llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+6-21 files

LLVM/project 9840966 — llvm/lib/CodeGen/GlobalISel LegalizerHelper.cpp, llvm/test/CodeGen/AArch64/GlobalISel legalize-fshr.mir legalize-fshl.mir

[GlobalISel] Don't set disjoint flag in lowerFunnelShiftAsShifts if the shift amount may be undef. (#237061)

lowerFunnelShiftAsShifts uses isNonZeroModBitWidthOrUndef to choose the
X << C | Y >> (BW - C) expansion. Allowing undef there is fine for
picking the expansion, but it does not justify the disjoint flag on the
G_OR. If an undef shift amount is chosen to be 0 modulo BW, the two
operands of the or may have common set bits, and the disjoint flag would
make the result poison.

Only set the disjoint flag on this path if every element of the shift
amount is a constant that is non-zero modulo the bitwidth.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+72-0llvm/test/CodeGen/AArch64/GlobalISel/legalize-fshr.mir
+72-0llvm/test/CodeGen/AArch64/GlobalISel/legalize-fshl.mir
+66-0llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-fshl-fshr-rv64.mir
+7-1llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+217-14 files

LLVM/project 385495a — llvm/lib/Target/RISCV RISCVISelLowering.cpp

[RISCV][P-ext] Split RV32 v2i32 riscv_pmerge code from v4i16 and v8i8. (#237358)

Lower using extract_vector_elt and build_pair rather than bitcasts and
extract_subvector. This is a more straightforward lowering and may
preserve more optimization opportunities.

Assisted-by: Claude
DeltaFile
+25-15llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+25-151 files

LLVM/project b0d5bf8 — llvm/lib/CodeGen/SelectionDAG SelectionDAGISel.cpp

[SelectionDAGISel] Const-correct the RecordedNodes argument of IsPredicateKnownToFail. NFC (#237508)
DeltaFile
+1-1llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+1-11 files

LLVM/project 8b254e8 — compiler-rt/lib/profile InstrProfilingPlatformGPU.c, compiler-rt/test/profile/GPU instrprof-hip-select-counters.hip instrprof-hip-variable-step.hip

[compiler-rt][profile] Sum lane-varying GPU counter increments (#235978)

The GPU profiling helper adds each active lane's contribution to a
shared counter. Its `step` argument is the amount that lane contributes.
For an ordinary block counter, every active lane has step 1. For a
select counter, step is 1 when that lane's condition is true and 0
otherwise.

For example, consider a 64-lane wave executing this select:

  result = (threadIdx.x % 2 == 0) ? a : b;

All 64 lanes are active, but even lanes have step 1 and odd lanes have
step 0. The counter should increase by 32. The old helper multiplies
the first active lane's step by the number of active lanes, so it adds
64 instead. Being active does not mean a lane's step is 1.

Compiler-generated counter steps are zero or one. Use a ballot to find
the lanes with step 1 and count its set bits. The first active lane adds
that count to the counter. Use the same count for the optional uniform
counter when the whole wave is active.
DeltaFile
+125-0compiler-rt/test/profile/GPU/instrprof-hip-variable-step.hip
+51-0compiler-rt/test/profile/GPU/instrprof-hip-select-counters.hip
+7-5compiler-rt/lib/profile/InstrProfilingPlatformGPU.c
+183-53 files

LLVM/project 2e5d9fe — libcxx/test CMakeLists.txt, libcxx/utils/libcxx/test params.py

[libc++][test] Forward LLVM_USE_LINKER to Lit test suites

Serialize LLVM_USE_LINKER as a use_linker Lit parameter in libcxx, libcxxabi, and libunwind so test binaries link with -fuse-ld=<linker> instead of falling back to the compiler's default system linker.

Assisted-by: Gemini
Pull-request: https://github.com/llvm/llvm-project/pull/237635
DeltaFile
+7-0libcxx/utils/libcxx/test/params.py
+4-0libunwind/test/CMakeLists.txt
+4-0libcxxabi/test/CMakeLists.txt
+4-0libcxx/test/CMakeLists.txt
+19-04 files

LLVM/project de658e3 — libcxx/test CMakeLists.txt, libcxx/utils/libcxx/test params.py

[spr] update

Created using spr 2.0.0-beta.2
DeltaFile
+7-0libcxx/utils/libcxx/test/params.py
+4-0libunwind/test/CMakeLists.txt
+4-0libcxxabi/test/CMakeLists.txt
+4-0libcxx/test/CMakeLists.txt
+19-04 files

LLVM/project 2482814 — clang/lib/CodeGen CGDebugInfo.cpp

[clang] Hash the main file only once for DWARF 5 checksums (#228926)

While looking for things that already has a cached result, I noticed
that the main file's DWARF 5 checksum is computed twice: once in
`CreateCompileUnit` and again in the first `getOrCreateFile()`, even
though the CU already has it.

It's a nice small win on debug builds (−0.72% on sqlite3, −0.17%
geomean) and it shouldn't change any behaviour:


https://llvm-compile-time-tracker.com/compare.php?from=018a46162a84070109760677031bcd636ed6026e&to=a62389e40c98a33e23395ea69c4dc495d8aec263&stat=instructions%3Au
DeltaFile
+3-0clang/lib/CodeGen/CGDebugInfo.cpp
+3-01 files

LLVM/project 82b757f — libcxx/test/extensions/gnu/hash specializations.verify.cpp

[libc++][test] Avoid assert() in gnu/hash/specializations.verify.cpp

PR: https://github.com/llvm/llvm-project/pull/237485

Assisted-by: Gemini
DeltaFile
+1-2libcxx/test/extensions/gnu/hash/specializations.verify.cpp
+1-21 files

LLVM/project 2ab8df3 — llvm/lib/Transforms/Scalar LowerMatrixIntrinsics.cpp, llvm/test/Transforms/LowerMatrixIntrinsics multiply-fused-loops.ll multiply-fused-differing-addr-spaces.ll

[Matrix] Align copies of fused load operands to the load's alignment. (#237471)

Make sure the alloca create by getNonAliasingPointer uses the load's
alignemnt, if smaller than the alloca alignemnt. Otherwise the alloca is
not aligned enough and the load is UB.
DeltaFile
+16-16llvm/test/Transforms/LowerMatrixIntrinsics/multiply-fused-differing-addr-spaces.ll
+4-4llvm/test/Transforms/LowerMatrixIntrinsics/multiply-fused-loops.ll
+2-0llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+22-203 files

LLVM/project bfbe7e0 — llvm/test/tools/llubi intr_matrix_transpose.ll, llvm/tools/llubi/lib Interpreter.cpp

[llubi] Add support for llvm.matrix.transpose. (#237457)

The input is treated as a column-major Rows * Cols matrix and the result
is its Cols * Rows transpose.

PR: https://github.com/llvm/llvm-project/pull/237457
DeltaFile
+15-0llvm/test/tools/llubi/intr_matrix_transpose.ll
+14-0llvm/tools/llubi/lib/Interpreter.cpp
+29-02 files

LLVM/project 6029bb7 — llvm/include/llvm/MC MCAsmInfo.h, llvm/lib/CodeGen/AsmPrinter AsmPrinter.cpp

[MC][NVPTX] Don't emit .addrsig for NVPTX (#200678)

PTX has no `.addrsig` directive, but AsmPrinter emits `.addrsig` and
`.addrsig_sym` whenever `TargetOptions::EmitAddrsig` is set, so `llc
-addrsig` produces PTX that ptxas rejects.
lld always sets `EmitAddrsig` for LTO, so this affects NVPTX bitcode
compiled with `ld.lld --lto-emit-asm` (#200679).

Add `MCAsmInfo::HasAddrsigDirective` and clear it for NVPTX.
NVPTX triples default to the ELF object format, so checking the object
format would not exclude them.

Co-authored-by: Fangrui Song <i at maskray.me>
DeltaFile
+9-0llvm/test/CodeGen/NVPTX/no-addrsig.ll
+5-0llvm/include/llvm/MC/MCAsmInfo.h
+1-1llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+1-0llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
+16-14 files

LLVM/project 6f2c693 — lld/ELF InputFiles.cpp Driver.cpp, lld/test lit.cfg.py

[ELF] Support NVPTX bitcode with --lto-emit-asm and --lto-emit-llvm (#200679)

rustc links NVPTX bitcode with a custom llvm-link/opt/llc pipeline
(rust-lang/rust#156921), which it would like to replace with lld.
lld rejects nvptx/nvptx64 bitcode because it cannot infer an `e_machine`
from the triple.

Map nvptx/nvptx64 bitcode to `EM_CUDA`, which serves only as an internal
tag for the LTO pipeline, and report an error unless `--lto-emit-asm` or
`--lto-emit-llvm` is specified.
Kernels are referenced only by the CUDA driver at run time, so they must
be exported (e.g. `--export-dynamic-symbol`, or `-shared` with a version
script) or LTO deletes them.

Valid PTX also requires #200678, which stops emitting `.addrsig` for
NVPTX.

Co-authored-by: Fangrui Song <i at maskray.me>
DeltaFile
+52-0lld/test/ELF/lto/nvptx-bitcode.ll
+4-0lld/ELF/Driver.cpp
+3-0lld/ELF/InputFiles.cpp
+1-0lld/test/lit.cfg.py
+60-04 files

LLVM/project d640cb5 — llvm/lib/Target/AMDGPU AMDGPUAttributor.cpp

[NFC][AMDGPU] Don't create call site AACallEdges for direct calls

AAAMDGPUMinAGPRAlloc and AAAMDGPUNoLDSDMA asked for a call site AACallEdges for
every call that is not an intrinsic, only to get its callees. For a direct call
whose callee has no callback metadata, that callee is the only one, so use it
directly, like AACallEdgesFunction does since #232616. Calls to callback brokers
still use AACallEdges, because thebroker also calls the callback target.

On a generated module with 2,001 functions and 15,986 calls,
-passes=amdgpu-attributor creates 2,001 instead of 11,987 abstract attributes,
and the median wall time goes from 95 ms to 84 ms.

This PR was assisted by AI but I reviewed all the changes.
DeltaFile
+36-27llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
+36-271 files

LLVM/project 6630551 — clang/lib/AST Decl.cpp

[AST] Avoid duplicate isOutOfLine() calls (NFC) (#237621)

This is fairly expensive, so make sure we only call it once.

Improves compile-time for C++ code, by -0.4% on the clang build.

Suggested by LLM. Original motivation was to reduce ASLR noise on
beman-execution.
DeltaFile
+3-2clang/lib/AST/Decl.cpp
+3-21 files

LLVM/project 608de88 — llvm/lib/Transforms/IPO AttributorAttributes.cpp

[NFC][Attributor] Reach fixpoint in call site AACallEdges for direct calls

A direct call whose callee has no callback metadata only calls its callee, so
its call site AACallEdges cannot change after initialization. Add the edge in
initialize and reach a fixpoint there, instead of updating the attribute twice
to find out. AACallEdgesFunction already skips the call site attribute for such
calls since #232616; both now share getOnlyCallee().

Other attributes still create call site AACallEdges for direct calls, e.g.,
AAInterFnReachability and the AMDGPU attributor. On a generated module with
2,001 functions and 15,986 calls, this removes all updates of call site
AACallEdges. The total number of updates goes from 304,263 to 272,291 with
-passes=attributor, from 207,815 to 175,843 with -passes=attributor-light, and
from 35,977 to 16,005 with -passes=amdgpu-attributor. The wall time does not
change measurably on that module, because these updates are cheap.

This PR was assisted by AI but I reviewed all the changes.
DeltaFile
+21-2llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+21-21 files

LLVM/project 8105147 — llvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU shufflevector.v3f16.v2f16.ll shufflevector.v3bf16.v2bf16.ll

[AMDGPU] Allow legal shuffles of four 16-bit lanes

Preserve packed 16-bit pairs so lowering can use op_sel and
v_pk_mov_b32 instead of extracting each half into a separate register.
Keep scalarization for other vector shapes to avoid inhibiting load
narrowing or introducing extra register copies.
DeltaFile
+51-76llvm/test/CodeGen/AMDGPU/shufflevector.v3f16.v3f16.ll
+51-76llvm/test/CodeGen/AMDGPU/shufflevector.v3bf16.v3bf16.ll
+7-9llvm/test/CodeGen/AMDGPU/shufflevector.v3f16.v2f16.ll
+7-9llvm/test/CodeGen/AMDGPU/shufflevector.v3bf16.v2bf16.ll
+8-4llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+124-1745 files

LLVM/project 2e69f3f — llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp

[SelectionDAG] Reject promoted extracts in build-vector shuffle folds

A promoted EXTRACT_VECTOR_ELT result can be wider than the source vector element. Require matching types before constructing the shuffle mask to avoid an incorrect lane count and assertions.
DeltaFile
+5-1llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+5-11 files

LLVM/project 69319a8 — compiler-rt/lib/scudo/standalone size_class_allocator.h

[scudo] Use memmove to move leftover elements in drain. (#237444)

Rather than loop over the array and move one by one, use the memmove
function. On a 64 bit Android device, in the system_server process, the
average time went from 68ns to 55ns. The worst case also went from
~250,000ns to ~45,000ns.
DeltaFile
+3-2compiler-rt/lib/scudo/standalone/size_class_allocator.h
+3-21 files

LLVM/project 6570974 — clang/lib/AST ExprConstant.cpp, clang/lib/Analysis BodyFarm.cpp

[clang] Remove unused local variables (NFC) (#237612)

This patch removes unused local variables of container, string, and
value types across clang/.

Note that these variables did not trigger -Wunused-variable because
their types have non-trivial constructors or destructors, and their
initializers have no side effects.

Assisted-by: Antigravity
DeltaFile
+0-6clang/lib/Analysis/BodyFarm.cpp
+0-4clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+0-3clang/lib/Sema/SemaDeclCXX.cpp
+0-2clang/utils/TableGen/ClangOptionDocEmitter.cpp
+0-2clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
+0-2clang/lib/AST/ExprConstant.cpp
+0-1911 files not shown
+0-3117 files

LLVM/project 7c7092d — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer revec.ll revec-shufflevector.ll

[SLP] Propagate lost IR flags to vectorized casts (#237240)

Vectorized casts lost the fast-math flags, nneg and trunc nuw/nsw of the scalar casts. Propagate them as for other nodes. nneg is dropped when the zext or uitofp operand is narrowed, or when a copyable zext lane is a constant that is not known non-negative in the source type. Trunc wrap flags are dropped when the trunc result is demoted and kept when only the source is narrowed, which still holds the low bits of the original value.
DeltaFile
+11-11llvm/test/Transforms/SLPVectorizer/AArch64/or-reduction-byte-pack.ll
+18-4llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+8-8llvm/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll
+4-4llvm/test/Transforms/SLPVectorizer/revec-shufflevector.ll
+2-2llvm/test/Transforms/SLPVectorizer/revec.ll
+2-2llvm/test/Transforms/SLPVectorizer/X86/logical-binops-booleanized-leaves.ll
+45-317 files not shown
+52-3813 files

LLVM/project 630bd7b — llvm/lib/Target/X86 X86ISelLowering.cpp

[X86] LowerRotate - remove AVX2-only vXi16 fallback. (#237609)

These are all handled by the pack/unpack pattern earlier on.
DeltaFile
+2-2llvm/lib/Target/X86/X86ISelLowering.cpp
+2-21 files

LLVM/project 5fb6ede — llvm/lib/Transforms/Vectorize LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize/RISCV evl-invalid-cost-remark.ll

[LV][RISCV] Fix crash in emitInvalidCostRemarks with EVL load/store recipes (#237063)

emitInvalidCostRemarks' TypeSwitch handled VPWidenLoadRecipe/
VPWidenStoreRecipe but not their EVL counterparts, causing
llvm_unreachable when remarks are enabled on RISC-V +v with minsize.

Add the two missing cases for
VPWidenLoadEVLRecipe/VPWidenStoreEVLRecipe.

Fixes #232281
DeltaFile
+27-0llvm/test/Transforms/LoopVectorize/RISCV/evl-invalid-cost-remark.ll
+5-0llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+32-02 files

LLVM/project 3b1603e — llvm/lib/Target/Sparc SparcISelDAGToDAG.cpp SparcPassRegistry.def, llvm/test/CodeGen/SPARC newpm-pipeline.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+379-392llvm/lib/Target/Sparc/DelaySlotFiller.cpp
+92-0llvm/test/CodeGen/SPARC/newpm-pipeline.ll
+91-0llvm/lib/Target/Sparc/SparcCodeGenPassBuilder.cpp
+24-3llvm/lib/Target/Sparc/Sparc.h
+21-0llvm/lib/Target/Sparc/SparcPassRegistry.def
+9-2llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp
+616-3973 files not shown
+629-3999 files

LLVM/project 087db56 — llvm/lib/Target/Sparc SparcTargetMachine.h Sparc.h, llvm/test/CodeGen/SPARC newpm-pipeline.ll

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+91-0llvm/test/CodeGen/SPARC/newpm-pipeline.ll
+91-0llvm/lib/Target/Sparc/SparcCodeGenPassBuilder.cpp
+20-0llvm/lib/Target/Sparc/SparcPassRegistry.def
+9-2llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp
+8-2llvm/lib/Target/Sparc/Sparc.h
+8-0llvm/lib/Target/Sparc/SparcTargetMachine.h
+227-42 files not shown
+231-58 files

LLVM/project cf23347 — llvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU shufflevector.v3f16.v2f16.ll shufflevector.v3bf16.v2bf16.ll

[AMDGPU] Allow legal shuffles of four 16-bit lanes

Preserve packed 16-bit pairs so lowering can use op_sel and
v_pk_mov_b32 instead of extracting each half into a separate register.
Keep scalarization for other vector shapes to avoid inhibiting load
narrowing or introducing extra register copies.
DeltaFile
+51-76llvm/test/CodeGen/AMDGPU/shufflevector.v3f16.v3f16.ll
+51-76llvm/test/CodeGen/AMDGPU/shufflevector.v3bf16.v3bf16.ll
+7-9llvm/test/CodeGen/AMDGPU/shufflevector.v3f16.v2f16.ll
+7-9llvm/test/CodeGen/AMDGPU/shufflevector.v3bf16.v2bf16.ll
+8-4llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+124-1745 files

LLVM/project 327434b — llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/unittests/Target/X86 X86SelectionDAGTest.cpp

[SelectionDAG] Reject promoted extracts in build-vector shuffle folds

A promoted EXTRACT_VECTOR_ELT result can have a wider type than the
source vector element. Using that result type to construct a shuffle
mask produces the wrong lane count and can assert. Require matching
types before forming the mask.

Construct the promoted extract directly in a DAG unit test because IR
lowering can replace its zero extension with a mask first.
DeltaFile
+28-0llvm/unittests/Target/X86/X86SelectionDAGTest.cpp
+5-1llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+33-12 files

LLVM/project 8592891 — llvm/lib/Target/Sparc SparcTargetMachine.h Sparc.h, llvm/test/CodeGen/SPARC newpm-pipeline.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+91-0llvm/test/CodeGen/SPARC/newpm-pipeline.ll
+91-0llvm/lib/Target/Sparc/SparcCodeGenPassBuilder.cpp
+20-0llvm/lib/Target/Sparc/SparcPassRegistry.def
+9-2llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp
+8-2llvm/lib/Target/Sparc/Sparc.h
+8-0llvm/lib/Target/Sparc/SparcTargetMachine.h
+227-42 files not shown
+231-58 files

LLVM/project 36a707d — llvm/lib/Target/Sparc SparcTargetMachine.cpp Sparc.h

[𝘀𝗽𝗿] changes to main this commit is based on

Created using spr 1.3.7

[skip ci]
DeltaFile
+9-2llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp
+8-2llvm/lib/Target/Sparc/Sparc.h
+2-1llvm/lib/Target/Sparc/SparcTargetMachine.cpp
+19-53 files

LLVM/project 5ab06be — llvm/lib/Analysis BlockFrequencyInfoImpl.cpp ModuleSummaryAnalysis.cpp, llvm/lib/Transforms/Instrumentation PGOInstrumentation.cpp

[Analysis] Port exported cl::opt variables to AnalysisOptions (#236844)

CodeGen, Passes, Instrumentation, MemProfContextDisambiguation and
llvm-ir2vec read Analysis options through extern declarations. Move
these options to AnalysisOptions, with getters that take an LLVMContext.

Remove IR2Vec Embedder's unused weight members, and the unittest's
writes to the weights, which only affect vocabularies loaded from a
file.

LLM-aided
DeltaFile
+26-47llvm/lib/Analysis/BlockFrequencyInfo.cpp
+57-0llvm/lib/Analysis/AnalysisOptions.td
+13-32llvm/lib/Analysis/IR2Vec.cpp
+14-21llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+9-23llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+12-17llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
+131-14026 files not shown
+267-28332 files