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 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

LLVM/project 3f3566c — clang/test/Interpreter pragma-optimize.cpp

[Test][clang-repl]Keep value names in clang-repl pragma-optimize.cpp (#235305)

The test added by aa6e40c073e6 checks for named values
(entry:, %x.addr, %x), which only appear when clang keeps value names.
That is the default in assertion builds, but non-assertion CI builds
discard them, so the CHECK-NEXT: entry: line fails. Pass
-fno-discard-value-names explicitly.

Assisted-By: Claude Opus 5.5
DeltaFile
+2-1clang/test/Interpreter/pragma-optimize.cpp
+2-11 files

LLVM/project 44c618a — llvm/lib/Target/Sparc SparcInstrInfo.h SparcInstrInfo.td, llvm/test/CodeGen/SPARC branches-relax.ll

[SPARC] Implement TargetInstrInfo::insertIndirectBranch() (#226678)

Implement `insertIndirectBranch` so that branch relaxation pass can
insert unconditional long-range branching.
Follow an approach similar to the one used in AVR and use the CALL
instruction to get a reach of 32-bit signed offset instead of emitting
actual indirect branches.
DeltaFile
+367-1llvm/test/CodeGen/SPARC/branches-relax.ll
+74-1llvm/lib/Target/Sparc/SparcInstrInfo.cpp
+47-3llvm/lib/Target/Sparc/SparcFrameLowering.cpp
+19-0llvm/lib/Target/Sparc/SparcMachineFunctionInfo.h
+11-0llvm/lib/Target/Sparc/SparcInstrInfo.td
+5-0llvm/lib/Target/Sparc/SparcInstrInfo.h
+523-52 files not shown
+532-58 files

LLVM/project 83ccd99 — libc/src/__support/math tanpif.h tanpif16.h, libc/test/src/math/smoke tanpif_test.cpp tanpif16_test.cpp

[libc][math] Fix tanpif and tanpif16 error handling
DeltaFile
+12-2libc/src/__support/math/tanpif16.h
+10-2libc/src/__support/math/tanpif.h
+12-0libc/test/src/math/smoke/tanpif16_test.cpp
+11-0libc/test/src/math/smoke/tanpif_test.cpp
+45-44 files

LLVM/project 99e4668 — llvm/lib/Target/RISCV RISCVInstrInfoP.td, llvm/test/CodeGen/RISCV rvp-scalar.ll

[RISCV][P-ext] Add isel pattern match for mulu.h01/mulu.h11 (#235226)

`mulu.h01` multiplies the zero-extended lower half word of rs1 by the
zero-extended upper half word of rs2, and `mulu.h11` multiplies the
zero-extended upper half words of both.

Previously, (srl X, 16) was selected as a separate srli feeding
`mulu.h00` or `mul`. Match it directly so the shift is folded.

zexti16 also matches (srl X, 16) since its upper bits are known zero, so
the new patterns need AddedComplexity to be tried before the `mulu.h00`
pattern, and `mulu.h11` before `mulu.h01`.
DeltaFile
+71-0llvm/test/CodeGen/RISCV/rvp-scalar.ll
+10-0llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+81-02 files

LLVM/project 1713a93 — llvm/include/llvm/Frontend/OpenMP OMP.td

[OpenMP] Add definition of task_iteration directive

This just adds the basic definitions of the directive (specifically the
definitions of the OMPD_task_iteration enum).

This isn't used or handled anywhere at the moment.
DeltaFile
+9-0llvm/include/llvm/Frontend/OpenMP/OMP.td
+9-01 files

LLVM/project 22b86ab — llvm/lib/Target/AVR AVRExpandPseudoInsts.cpp, llvm/test/CodeGen/AVR std-ldd-tiny.ll

[AVR] Address review comments on AVRTiny spills

Document that STDPtrQRr and LDDRdPtrQ are only treated as pseudo
instructions on AVRTiny, and check atmega328 instead of -O0 in
std-ldd-tiny.ll so the test contrasts the two kinds of cores.
DeltaFile
+93-198llvm/test/CodeGen/AVR/std-ldd-tiny.ll
+4-0llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp
+97-1982 files

LLVM/project ea1b542 — llvm/lib/Analysis LazyValueInfo.cpp, llvm/test/Transforms/CorrelatedValuePropagation basic.ll

[LVI] constant fold not condition if val has condition as operand. (#235278)

proof: https://alive2.llvm.org/ce/z/fq0q2N
DeltaFile
+21-0llvm/test/Transforms/CorrelatedValuePropagation/basic.ll
+6-3llvm/lib/Analysis/LazyValueInfo.cpp
+27-32 files

LLVM/project e315d34 — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 bit-test-narrowed-samesign.ll

[SLP]Drop samesign of narrowed bit test compares (#235287)

The bit tests compare and L, R, which sign-extends from the narrow type
only
if both L and R do, so its sign may change after narrowing.

Fixes
https://github.com/llvm/llvm-project/pull/233124#issuecomment-6382644843

Assisted-by: Cursor
DeltaFile
+14-9llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+2-2llvm/test/Transforms/SLPVectorizer/X86/bit-test-narrowed-samesign.ll
+16-112 files

LLVM/project 237b420 — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 bit-test-narrowed-samesign.ll minbw-alt-cast-demoted-operand.ll

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

Created using spr 1.3.7

[skip ci]
DeltaFile
+244-0llvm/test/Transforms/SLPVectorizer/X86/minbw-alt-cast-demoted-operand.ll
+178-0llvm/test/Transforms/SLPVectorizer/X86/bit-test-narrowed-samesign.ll
+98-26llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+520-263 files

LLVM/project 901ef4f — llvm/test/Transforms/SLPVectorizer/X86 bit-test-narrowed-samesign.ll

[SLP][NFC]Add a test with incorrect vectorization, NFC (#235285)
DeltaFile
+178-0llvm/test/Transforms/SLPVectorizer/X86/bit-test-narrowed-samesign.ll
+178-01 files

LLVM/project fe1f1fa — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 minbw-alt-cast-demoted-operand.ll

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

Created using spr 1.3.7

[skip ci]
DeltaFile
+244-0llvm/test/Transforms/SLPVectorizer/X86/minbw-alt-cast-demoted-operand.ll
+98-26llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+342-262 files

LLVM/project 3b3638c — llvm/include/llvm/Frontend/OpenMP OMP.td

[OpenMP] Add definition of begin/end metadirective

This just adds the basic definitions of the directives (specifically the
definitions of the OMPD_begin_metadirective and OMP_end_metadirective
enums).

This isn't used or handled anywhere at the moment.
DeltaFile
+18-0llvm/include/llvm/Frontend/OpenMP/OMP.td
+18-01 files

LLVM/project a0f9869 — llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 minbw-alt-cast-demoted-operand.ll

[SLP]Fix alternate casts of demoted operand (#235280)

sext/sitofp of an unsigned demoted operand must be zext/uitofp, and
zext/uitofp cannot absorb the sign extension of a signed demoted
operand,
so the operand must be extended back first.

Fixes
https://github.com/llvm/llvm-project/issues/234923#issuecomment-6373744225

Assisted-by: Cursor
DeltaFile
+98-26llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+8-10llvm/test/Transforms/SLPVectorizer/X86/minbw-alt-cast-demoted-operand.ll
+106-362 files

LLVM/project 39be2b6 — llvm/test/Transforms/SLPVectorizer/X86 minbw-alt-cast-demoted-operand.ll

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

Created using spr 1.3.7

[skip ci]
DeltaFile
+246-0llvm/test/Transforms/SLPVectorizer/X86/minbw-alt-cast-demoted-operand.ll
+246-01 files

LLVM/project a58a227 — llvm/include/llvm/CodeGen SlotIndexes.h, llvm/lib/CodeGen LiveIntervals.cpp SlotIndexes.cpp

[CodeGen] Drop dead SlotIndexes before allocation (#224031)

SlotIndexes keeps the index list entry of an erased instruction and only
clears its instruction pointer. Live range sizes are measured in slot
indexes and greedy ranks ranges by size, so the leftovers inflate some
ranges more than others and reorder allocation, spilling heavily on
register-starved functions.

Add SlotIndexes::compactIndexes() to erase them. Erased entries are
unlinked, so holding an index to one is now a bug; linkedEntry() asserts
on it. The one analysis that did was LiveIntervals, so add
removeUnreferencedIntervals() to retire the intervals responsible.

Off by default behind -greedy-compact-slot-indexes, since it changes
allocation across much of the test suite.

The test file greedy-compact-slot-indexes-priority.mir by Q. Colombet.
DeltaFile
+288-0llvm/unittests/CodeGen/SlotIndexesTest.cpp
+82-0llvm/test/CodeGen/AMDGPU/greedy-compact-slot-indexes-priority.mir
+43-0llvm/lib/CodeGen/SlotIndexes.cpp
+35-0llvm/test/CodeGen/AMDGPU/greedy-compact-slot-indexes.ll
+23-6llvm/include/llvm/CodeGen/SlotIndexes.h
+17-0llvm/lib/CodeGen/LiveIntervals.cpp
+488-62 files not shown
+504-78 files

LLVM/project 4b0b58f — llvm/test/Transforms/SLPVectorizer/X86 minbw-alt-cast-demoted-operand.ll

[SLP][NFC]Add a test with incorrect vectorization, NFC (#235277)
DeltaFile
+246-0llvm/test/Transforms/SLPVectorizer/X86/minbw-alt-cast-demoted-operand.ll
+246-01 files

LLVM/project 63107e0 — clang/include/clang/StaticAnalyzer/Core/BugReporter BugReporter.h, clang/lib/StaticAnalyzer/Checkers/WebKit RawPtrRefMemberChecker.cpp RawPtrRefLocalVarsChecker.cpp

[analyzer][NFC] Forward-declare Preprocessor in BugReporter.h

BugReporter.h includes clang/Lex/Preprocessor.h, and that single edge
pulls the whole Lex subtree -- roughly 34 headers, among them
Basic/Module.h, HeaderSearch.h and ModuleMap.h -- into 161 of the 197
translation units that make up clangStaticAnalyzerCore,
clangStaticAnalyzerCheckers and clangStaticAnalyzerFrontend. The
mechanism is transitive inclusion, not any use of the preprocessor:
nearly every analyzer source reaches BugReporter.h, so nearly every one
of them parses Preprocessor.h and everything it brings with it.

The include is not needed. Preprocessor appears in this header only as a
reference return type in three declarations, and no member of it is ever
named, so a forward declaration in namespace clang suffices and the
generated code is identical. Eight .cpp files were relying on
SourceManager completeness arriving through Preprocessor.h and now
include clang/Basic/SourceManager.h directly; that is the only
compensating change, and no translation unit needed Preprocessor.h
added back.

    [14 lines not shown]
DeltaFile
+1-1clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h
+1-0clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefMemberChecker.cpp
+1-0clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefLocalVarsChecker.cpp
+1-0clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefLambdaCapturesChecker.cpp
+1-0clang/lib/StaticAnalyzer/Checkers/WebKit/RawPtrRefCallArgsChecker.cpp
+1-0clang/lib/StaticAnalyzer/Checkers/WebKit/ForwardDeclChecker.cpp
+6-13 files not shown
+9-19 files

LLVM/project c7573b4 — clang/include/clang/StaticAnalyzer/Core/PathSensitive AnalysisManager.h, clang/lib/StaticAnalyzer/Checkers ArrayBoundChecker.cpp

[analyzer][NFC] Forward-declare Preprocessor in AnalysisManager.h

AnalysisManager.h includes clang/Lex/Preprocessor.h, and through that
one edge the whole Lex subtree -- roughly 34 headers, among them
Basic/Module.h, HeaderSearch.h and ModuleMap.h -- is parsed by 147 of
the 197 translation units in clangStaticAnalyzerCore,
clangStaticAnalyzerCheckers and clangStaticAnalyzerFrontend. The
mechanism is transitive inclusion: AnalysisManager.h sits under almost
every analyzer source, so almost every one of them pays for the
preprocessor without naming it.

Preprocessor is used here only as a reference member, a constructor
parameter and a reference-returning accessor; no member of it is ever
named, so a forward declaration in namespace clang suffices and the
generated code is identical. The include is replaced by
clang/Basic/SourceManager.h rather than simply dropped, because
isInCodeFile() calls SM.isInMainFile(), SM.getIncludeLoc(),
SM.getFileID() and SM.getFilename(), and SourceManager is otherwise
unreachable from this header once Preprocessor.h is gone. That swap is

    [21 lines not shown]
DeltaFile
+2-1clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
+1-0clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
+3-12 files

LLVM/project c89ab29 — clang/include/clang/StaticAnalyzer/Core/BugReporter Z3CrosscheckVisitor.h BugReporterVisitors.h

[analyzer][NFC] BugReporterVisitors.h should include MemRegion.h

BugReporterVisitors.h includes RangedConstraintManager.h but uses
nothing it declares: RangeSet, Range, ConstraintMap and
SimpleConstraintManager appear nowhere in the file. What the header
actually needs is MemRegion.h, which supplies SubRegion,
MemRegionManager and MemRegion completeness for an inline constructor;
today those arrive only by accident, transitively through
RangedConstraintManager.h -> ProgramState.h. Swapping the include for
the one that carries the used declarations makes the dependency honest
and adds a forward declaration of CallEvent in namespace clang::ento
for the one name that only needs to be incomplete.

One header needs a compensating include: Z3CrosscheckVisitor.h uses
ConstraintMap and was getting RangedConstraintManager.h through
BugReporterVisitors.h, so it now includes it directly. No translation
unit in clangStaticAnalyzerCore, clangStaticAnalyzerCheckers or
clangStaticAnalyzerFrontend required any other change.


    [3 lines not shown]
DeltaFile
+2-1clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
+1-0clang/include/clang/StaticAnalyzer/Core/BugReporter/Z3CrosscheckVisitor.h
+3-12 files

LLVM/project 0765691 — llvm/lib/Target/AArch64 AArch64Combine.td, llvm/lib/Target/AArch64/GISel AArch64PreLegalizerCombiner.cpp

[AArch64][GlobalISel] Add deinterleaved store combine. (#228514)

This adds a combine for converting store(shuffle) into a ST2/ST3/ST4.
The idea is that this can be extended to support interleave /
deinterleave intrinsics in the future once those are supported.
DeltaFile
+59-111llvm/test/CodeGen/AArch64/interleaved-accesses.ll
+148-0llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
+17-55llvm/test/CodeGen/AArch64/vldn_shuffle.ll
+10-1llvm/lib/Target/AArch64/AArch64Combine.td
+234-1674 files

LLVM/project 04b1426 — clang/lib/CIR/CodeGen CIRGenCleanup.cpp, clang/test/CIR/CodeGen cleanup-scope-tmp.cpp array-ctor.cpp

[CIR] Fix temporary cleanup boundaries for asm and coroutines (#234664)

- Destroy asm operand temporaries at the end of the asm statement.
- Defer resume-expression temporary cleanups to the end of the enclosing
full-expression
- Clean up array-element default-argument temporaries before
constructing the next element, preserving lifetime extension.
- Keep conditional cleanup scopes open until the end of their owning
full-expression.

Note that this overlaps with #234303. I will rebase either depending on
which one gets merged first.

Assisted-By: Claude Opus 5.5
DeltaFile
+430-4clang/test/CIR/CodeGenCoroutines/coro-agg.cpp
+335-0clang/test/CIR/CodeGen/cleanup-conditional-eh.cpp
+281-0clang/test/CIR/CodeGen/cleanup-conditional.cpp
+188-7clang/test/CIR/CodeGen/array-ctor.cpp
+83-22clang/lib/CIR/CodeGen/CIRGenCleanup.cpp
+95-1clang/test/CIR/CodeGen/cleanup-scope-tmp.cpp
+1,412-348 files not shown
+1,562-5814 files