LLVM/project c0815b9 — llvm/lib/Target/ARM MVETPAndVPTOptimisationsPass.cpp, llvm/test/CodeGen/Thumb2/LowOverheadLoops revert-after-call-preheader.mir

[ARM] Replace reg in preheader when reverting WhileLoopStartLR (#229754)

As we revert a wls loop to a dls loop, we remove the t2WhileLoopStartLR
to a t2DoLoopStart at the start of the preheader. In finding the
t2WhileLoopStartLR we might have looked through a copy that is still
using the t2WhileLoopStartLR def. Make sure we replace the use with the
Src to remain valid.

Fixes #229400
DeltaFile
+220-0llvm/test/CodeGen/Thumb2/LowOverheadLoops/revert-after-call-preheader.mir
+9-0llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp
+229-02 files

LLVM/project de39e75 — llvm/include/llvm/IR Operator.h

[IR] Remove unused GEPOperator::countNonConstantIndices (NFC) (#235233)

The last callers of GEPOperator::countNonConstantIndices were removed
on April 26, 2024 in commit cbe1760f02882328c91e5764648f97fe644f44c9.

Assisted-by: Antigravity
DeltaFile
+0-6llvm/include/llvm/IR/Operator.h
+0-61 files

LLVM/project ee824d2 — clang/include/clang/AST ExprCXX.h ExternalASTSource.h, clang/include/clang/StaticAnalyzer/Core/PathSensitive CallEvent.h

[clang] Replace PointerUnion::dyn_cast with llvm::dyn_cast (NFC) (#235232)

PointerUnion::dyn_cast has been soft-deprecated in favor of
llvm::dyn_cast and llvm::dyn_cast_if_present.  This patch replaces
PointerUnion::dyn_cast with llvm::dyn_cast at 17 call sites across 11
files under clang/.

All tests in check-clang pass with these changes, and LLM-based static
analysis of the surrounding data structures and call sites confirms that
the PointerUnion operand at each site is nonnull either by construction
or because callers ensure it is nonnull before reaching llvm::dyn_cast.

Assisted-by: Antigravity
DeltaFile
+5-5clang/include/clang/AST/DeclTemplate.h
+2-4clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
+3-3clang/include/clang/AST/ExternalASTSource.h
+3-2clang/lib/Serialization/MultiOnDiskHashTable.h
+2-2clang/include/clang/AST/ExprCXX.h
+1-1clang/lib/Serialization/ASTWriter.cpp
+16-175 files not shown
+21-2211 files

LLVM/project f45474e — llvm/lib/CodeGen/SelectionDAG SDNodeInfo.cpp

Revert "[SelectionDAG] Implement SDTCisSameAs in verifyNode." (#235329)

M68k is failing on the bots. I'll need to fix it or waive the broken
node, but I need time to investigate.

Reverts #235157
DeltaFile
+1-10llvm/lib/CodeGen/SelectionDAG/SDNodeInfo.cpp
+1-101 files

LLVM/project 4f2421f — llvm/include/llvm/Transforms/Utils BuildLibCalls.h, llvm/lib/Analysis TargetLibraryInfo.cpp

[TLI][SimplifyLibCalls] Accept [2 x iN] return type for __size_returing_new (#234856)

On AArch64 (AAPCS64), Clang lowers `struct __sized_ptr_t { void *p;
size_t n; }` as `[2 x i64]` (`llvm::ArrayType`), whereas on x86_64 it is
lowered as `{ ptr, i64 }` (`llvm::StructType`).

Additionally, `emitHotColdSizeReturningNew` and
`emitHotColdSizeReturningNewAligned` in `BuildLibCalls.cpp` previously
hardcoded `StructType::get(B.getContext(), {B.getPtrTy(), SizeTTy})` as
the return type of the newly emitted `_hot_cold` call, which would fail
`replaceAllUsesWith` when replacing a call returning `[2 x i64]`.

Assisted-by: Gemini Argon
DeltaFile
+37-0llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
+12-12llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+6-6llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+12-0llvm/test/Transforms/InstCombine/simplify-libcalls-new.ll
+5-5llvm/include/llvm/Transforms/Utils/BuildLibCalls.h
+7-3llvm/lib/Analysis/TargetLibraryInfo.cpp
+79-263 files not shown
+99-319 files

LLVM/project 34379c8 — mlir/lib/IR MLIRContext.cpp

[mlir] Skip uniquer locks when a context starts without threading (#235294)
DeltaFile
+9-4mlir/lib/IR/MLIRContext.cpp
+9-41 files

LLVM/project f99a018 — llvm/include/llvm/CodeGen BasicBlockMatchingAndInference.h, llvm/lib/CodeGen TargetPassConfig.cpp CodeGenOptions.td

[CodeGen] Move BasicBlockMatchingAndInference options to CodeGenOptions.td (#235180)

Move -propeller-match-bbid and -propeller-infer-threshold from cl::opt
in BasicBlockMatchingAndInference.cpp to CodeGenOptions.td. This avoids
exposing PropellerMatchBBID in BasicBlockMatchingAndInference.h and
including that header in TargetPassConfig.cpp.
DeltaFile
+4-14llvm/lib/CodeGen/BasicBlockMatchingAndInference.cpp
+6-0llvm/lib/CodeGen/CodeGenOptions.td
+0-4llvm/include/llvm/CodeGen/BasicBlockMatchingAndInference.h
+1-2llvm/lib/CodeGen/TargetPassConfig.cpp
+11-204 files

LLVM/project 9cf173d — llvm/lib/CodeGen MachinePipeliner.cpp, llvm/lib/Passes CodeGenPassBuilder.cpp

CodeGen: Consolidate MachinePipeliner controls (#235311)

This pass followed the anti-pattern of having a cl::opt in the pass
which early returned instead of not adding the pass to the pipeline in
the first place.  Additionally several targets had their own cl::opts
used from the subtarget enablement hook.

Consolidate this into one generic control with a subtarget hook to
enable the pipeliner, following the example of enable-misched /
enableMachineScheduler.

Adding the nop pass still had the side effect of running the required
analyses which exposed issues. In particular this hides failures in
PPC with the defaults. The LiveIntervals dependency would assert if
there were unreachable blocks which was possible with the point PPC
inserted the pass.

Hexagon's hardware loop passes move to the end of
addMachineSSAOptimization so they still run before the pipeliner.

    [6 lines not shown]
DeltaFile
+19-12llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
+0-9llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+8-0llvm/lib/Passes/CodeGenPassBuilder.cpp
+0-7llvm/test/CodeGen/PowerPC/O3-pipeline.ll
+0-7llvm/lib/CodeGen/MachinePipeliner.cpp
+1-6llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+28-4159 files not shown
+100-11065 files

LLVM/project a32ac19 — flang/test/Evaluate fold-specific-minmax-kind.f90 fold-real10-storage-size.f90, flang/unittests/Evaluate RealValueTest.cpp IntegerValueTest.cpp

The AI is nitpicking
DeltaFile
+1-1flang/unittests/Evaluate/RealValueTest.cpp
+1-1flang/unittests/Evaluate/IntegerValueTest.cpp
+1-1flang/test/Evaluate/fold-specific-minmax-kind.f90
+1-1flang/test/Evaluate/fold-real10-storage-size.f90
+4-44 files

LLVM/project 4ba1f60 — flang/include/flang/Evaluate call.h type.h, flang/lib/Evaluate constant.cpp real-value.cpp

Additional CHECK for kind

Idea to use IsValidKindOfIntrinsicType by ChatGPT 5.6-Sol
DeltaFile
+8-8flang/lib/Evaluate/real-value-impl.cpp
+5-9flang/include/flang/Evaluate/type.h
+6-2flang/include/flang/Evaluate/call.h
+2-3flang/lib/Evaluate/fold-integer.cpp
+3-1flang/lib/Evaluate/real-value.cpp
+3-0flang/lib/Evaluate/constant.cpp
+27-236 files

LLVM/project c2f08a0 — llvm/lib/Target/AMDGPU SIFrameLowering.cpp

[AMDGPU] Use addressable arch VGPR count for CFI

emitPrologueEntryCFI assumed 1024 arch VGPRs on targets with VGPR
MSBs, regardless of wave size. In wave64 only 512 are addressable, and
VGPRs above that have no DWARF number. Use
getAddressableNumArchVGPRs, as whole wave function handling already
does.

No upstream target with VGPR MSBs supports wave64. NFC.

Change-Id: Ic65c4bb284e8583395bbe98ceeccd0f46b877538
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+1-1llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+1-11 files

LLVM/project 625d950 — llvm/test/Transforms/SandboxVectorizer/Passes/BundleVec/AMDGPU lit.local.cfg

[SandboxVec] Remove empty test directory (NFC) (#235015)

This removes `Passes/BundleVec/AMDGPU/` as there are no tests left in
this directory after https://github.com/llvm/llvm-project/pull/234432
DeltaFile
+0-2llvm/test/Transforms/SandboxVectorizer/Passes/BundleVec/AMDGPU/lit.local.cfg
+0-21 files

LLVM/project bb03382 — flang/lib/Evaluate real-value.cpp real-value-impl.h, flang/test/Evaluate fold-exponent-default-kind.f90

Pass return kind to EXPONENT
DeltaFile
+9-6flang/lib/Evaluate/real-value-impl.cpp
+5-5flang/unittests/Evaluate/RealValueTest.cpp
+6-0flang/test/Evaluate/fold-exponent-default-kind.f90
+4-1flang/lib/Evaluate/fold-integer.cpp
+1-1flang/lib/Evaluate/real-value.cpp
+1-1flang/lib/Evaluate/real-value-impl.h
+26-141 files not shown
+27-157 files

LLVM/project 0a4d730 — llvm/lib/TargetParser AMDGPUTargetParser.cpp

[AMDGPU] Derive addressable VGPRs from encoding width

The addressable VGPR count is bounded by both the operand encoding
width and the register file size. Compute it as the smaller of the two
instead of listing per-target values. Wave64 on targets with VGPR MSBs
was already min(1024, 512). NFC.

Change-Id: Ia0e030a9005fb2e915ef09e4ac7fd5ded22ab9b2
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+7-2llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+7-21 files

LLVM/project efe3e8e — llvm/lib/Target/AMDGPU SOPInstructions.td SIISelLowering.cpp, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.cpp

[AMDGPU] Rename 1024AddressableVGPRs to VGPRMSBs

Most users of this feature ask whether the target has VGPR MSBs:
S_SET_VGPR_MSB, VGPR encoding lowering, MSB decoding and inline asm
register classes. 1024 follows from an 8-bit operand field plus 2 MSBs.

Name the feature after the capability so VGPR counts can be derived
from the encoding width. NFC.

Change-Id: I4da9b113260bb73cc60119836918ad16c09687ba
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+4-4llvm/lib/Target/AMDGPU/GCNFeatures.td
+2-2llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+2-2llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+1-1llvm/unittests/TargetParser/TargetParserTest.cpp
+1-1llvm/lib/Target/AMDGPU/SOPInstructions.td
+1-1llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+11-114 files not shown
+15-1510 files

LLVM/project 1658fb4 — llvm/lib/CodeGen/SelectionDAG SDNodeInfo.cpp

Revert "[SelectionDAG] Implement SDTCisSameAs in verifyNode. (#235157)"

This reverts commit a98c5c2b79b6afe17e831f4962f7f1fa27e9ad86.
DeltaFile
+1-10llvm/lib/CodeGen/SelectionDAG/SDNodeInfo.cpp
+1-101 files

LLVM/project 60c2f3e — runtimes/cmake config-Fortran.cmake

[runtimes][Fortran] No introspection in bootstrapping build (#234424)

In a bootstrapping build, flang is only built for the runtime's build
step, but not the configure step. That means the the result of Fortran
compiler introspection is unreliable. Don't attempt
`check_fortran_builtins_available()` in a bootstrapping configure.

One may think that any compiler introspection will just fail as intended
if flang is not even available, but
https://github.com/llvm/llvm-project/pull/209482#issuecomment-6202154199
describes how it may pass: `fakeflang` just runs the preprocessor (which
is sufficient for CMake to detect LLVMFlang), but
`check_fortran_builtins_available`'s check is intended to fail during
symbol resolution.
DeltaFile
+6-0runtimes/cmake/config-Fortran.cmake
+6-01 files

LLVM/project e8eba6e — llvm/test/CodeGen/AMDGPU flat-saddr-atomics.ll, llvm/test/CodeGen/AMDGPU/GlobalISel extractelement.ll llvm.amdgcn.image.atomic.dim.a16.ll

AMDGPU: Don't reserve the implicit buffer pointer with architected flat scratch (#235258)

Mesa shaders always had s[0:1] reserved for the implicit buffer
pointer, which is only needed to set up the scratch buffer
resource. With architected flat scratch, scratch is initialized by the
hardware and the pointer is unused. The driver stopped passing this
pointer so all user SGPRs were off by 2.

Don't reserve it on targets with architected flat scratch, so the user
SGPRs of Mesa shaders start at s0. Diagnose the use in the unsupported
contexts. This fixes many test failures on my system when running
piglit.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+2,112-452llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.dim.a16.ll
+1,222-1,222llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll
+738-856llvm/test/CodeGen/AMDGPU/GlobalISel/insertelement.ll
+779-753llvm/test/CodeGen/AMDGPU/flat-saddr-atomics.ll
+84-1,344llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.image.atomic.dim.a16.ll
+673-574llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement.ll
+5,608-5,201107 files not shown
+17,248-15,047113 files

LLVM/project 7bcef9f — llvm/lib/CodeGen RegAllocBase.cpp, llvm/test/CodeGen/AMDGPU regalloc-failure-subreg-def-regunits.mir

RegAlloc: Only def the subregister regunits of a failed subregister def (#235307)

After an allocation failure, cleanupFailedDefs added each failed def to
the live ranges of all regunits of the assigned register. A subregister
def only writes the subregister, so the remaining units got a def from
an instruction that does not modify them, which the verifier rejects.

Fixes ran-out-of-registers-errors.ll with EXPENSIVE_CHECKS after
#233796.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+26-0llvm/test/CodeGen/AMDGPU/regalloc-failure-subreg-def-regunits.mir
+5-1llvm/lib/CodeGen/RegAllocBase.cpp
+31-12 files

LLVM/project 3736dfe — llvm/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp, llvm/test/CodeGen/RISCV jumptable-cf-protection.ll

[SelectionDAG][RISCV][X86] Keep jump table range checks with cf-protection-branch (#234733)

When the default of a switch is unreachable, SelectionDAGBuilder elides
the jump table range check, except when ARM branch-target-enforcement is
enabled, since an unchecked table branch can be a JOP gadget.

Extend this to the cf-protection-branch module flag used by RISC-V
Zicfilp and X86 IBT. The module flag is merged with Module::Min
behavior, so a value of 0 is treated as not enabled.

Assisted-by: Claude
DeltaFile
+142-0llvm/test/CodeGen/X86/jumptable-cf-protection.ll
+117-0llvm/test/CodeGen/RISCV/jumptable-cf-protection.ll
+14-8llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+273-83 files

LLVM/project cfe60cf — llvm/lib/Target/RISCV RISCVISelLowering.cpp

[RISCV] Use vector getConstant. NFC (#235152)

It will eventually be legalized to a splat_vector and constant, but we
usually use a vector getConstant so let's be consistent.
DeltaFile
+1-2llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+1-21 files

LLVM/project e339ea8 — llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp

[DAGCombiner] Delay calls to willNotOverflow and SignBitIsZero in foldABSToABD. (#235129)

Do the cheaper hasOperation checks first
DeltaFile
+5-10llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+5-101 files

LLVM/project 45e57b7 — llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp

[TargetLowering] Don't call SignBitIsZero for ABDS in expandABD. (#235134)
DeltaFile
+2-2llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+2-21 files

LLVM/project a98c5c2 — llvm/lib/CodeGen/SelectionDAG SDNodeInfo.cpp

[SelectionDAG] Implement SDTCisSameAs in verifyNode. (#235157)

Assisted-by: Claude
DeltaFile
+10-1llvm/lib/CodeGen/SelectionDAG/SDNodeInfo.cpp
+10-11 files

LLVM/project 12260ac — llvm/lib/CodeGen MachinePipeliner.cpp, llvm/lib/Passes CodeGenPassBuilder.cpp

CodeGen: Consolidate MachinePipeliner controls

This pass followed the anti-pattern of having a cl::opt in the pass
which early returned instead of not adding the pass to the pipeline in
the first place.  Additionally several targets had their own cl::opts
used from the subtarget enablement hook.

Consolidate this into one generic control with a subtarget hook to
enable the pipeliner, following the example of enable-misched /
enableMachineScheduler.

Adding the nop pass still had the side effect of running the required
analyses which exposed issues. In particular this hides failures in
PPC with the defaults. The LiveIntervals dependency would assert if
there were unreachable blocks which was possible with the point PPC
inserted the pass.

Hexagon's hardware loop passes move to the end of
addMachineSSAOptimization so they still run before the pipeliner.

    [7 lines not shown]
DeltaFile
+19-12llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
+0-9llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+8-0llvm/lib/Passes/CodeGenPassBuilder.cpp
+0-7llvm/test/CodeGen/PowerPC/O3-pipeline.ll
+0-7llvm/lib/CodeGen/MachinePipeliner.cpp
+1-6llvm/lib/Target/PowerPC/PPCSubtarget.cpp
+28-4159 files not shown
+100-11065 files

LLVM/project bfe0941 — mlir/lib/Dialect/Linalg/Transforms DropUnitDims.cpp, mlir/test/Dialect/Linalg drop-unit-extent-dims.mlir

[mlir][linalg] Handle `DropPadUnitDims` when padding value is defined inside the pad body (#223712)

`DropPadUnitDims` reused the pad's padding value as-is when building the
replacement `tensor.pad`.
If that value was defined inside the original pad's own body, the new op
ended up referencing it from outside its region, and erasing the
original pad then hit an assertion.

This PR clone the defining op when the padding value lives inside the
pad body.

Fixes #203813

---------

Signed-off-by: Federico Bruzzone <federico.bruzzone.i at gmail.com>
DeltaFile
+43-0mlir/test/Dialect/Linalg/drop-unit-extent-dims.mlir
+4-0mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
+47-02 files

LLVM/project 127d4f0 — clang-tools-extra/clang-tidy/misc ConstCorrectnessCheck.cpp, clang-tools-extra/docs ReleaseNotes.md

[clang-tidy] Don't suggest const on `std::moved` locals in templates … (#226577)

[clang-tidy] Don't suggest const on std::moved locals in templates

Skip diagnostics in template instantiations for locals that are used as
arguments of std::move.
Reason: for some instantiations the move may be converted to copy so the
variable may look unmutated and flagged, whereas for other template
instantiations the real move semantics may apply.

Fixes: #225395

Assisted by Gemini for constructing the matcher.

---------

Co-authored-by: Zeyi Xu <zeyi2 at nekoarch.cc>
DeltaFile
+27-3clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
+20-0clang-tools-extra/test/clang-tidy/checkers/misc/const-correctness-templates.cpp
+6-2clang-tools-extra/docs/ReleaseNotes.md
+53-53 files

LLVM/project 2d46c2b — llvm/test/CodeGen/AMDGPU sched_mfma_rewrite_copies.mir

[AMDGPU][NFC] Harden sched_mfma_rewrite_copies.mir rewrite cases

The only functions in this test that are rewritten to AGPR form are
noncandidate_mfma_def_feeds_candidate_src2 and
av_mov_imm_src2_def_escapes_to_vgpr_user, added by #200972. Both are
balanced exactly on the RewriteMFMAFormStage cost threshold. Any
change that lowers the measured region pressure removes the rewrites
and the original intention of this test is lost.

The spill reduction is bounded by the number of rewrite-candidate
lanes live at the region's peak pressure. Keep more chain values live
through MFMA operands and keep the chain members rewrite candidates.

The properties under test are unchanged: the first MFMA in the first
function is still a non-candidate whose result feeds a candidate's
src2, and the AV_MOV_B64_IMM_PSEUDO in the second still escapes to a
VGPR user, so both still need bridge copies.

Co-authored-by: Cursor <cursoragent at cursor.com>
DeltaFile
+10-6llvm/test/CodeGen/AMDGPU/sched_mfma_rewrite_copies.mir
+10-61 files

LLVM/project 5ab1407 — flang/include/flang/Evaluate type.h, flang/lib/Evaluate tools.cpp

Proofreading
DeltaFile
+2-2flang/lib/Evaluate/tools.cpp
+1-1flang/include/flang/Evaluate/type.h
+3-32 files

LLVM/project 5916210 — mlir/lib/Rewrite PatternApplicator.cpp

[mlir] Find the pattern dump root only when IR debugging is enabled (#233771)

Extracted from https://github.com/llvm/llvm-project/pull/231423

`PatternApplicator` debug printing was unconditionally calling
`getDumpRootOp` which walks nested ops chains. This was taking a
noticeable time in synthetic 1000-nested test. Call `getDumpRootOp` only
if printing is actually enabled.
DeltaFile
+4-1mlir/lib/Rewrite/PatternApplicator.cpp
+4-11 files