LLVM/project 64df596 — llvm/utils/gn/secondary/clang/lib/Driver BUILD.gn

[gn build] Port 8c5088f848519 (#235502)
DeltaFile
+1-0llvm/utils/gn/secondary/clang/lib/Driver/BUILD.gn
+1-01 files

LLVM/project c930b91 — llvm/lib/Transforms/Utils VNCoercion.cpp, llvm/test/Transforms/GVN ptr-vector-coercion.ll

[GVN] Forward pointer vectors of equal size with `bitcast`
DeltaFile
+31-12llvm/test/Transforms/GVN/ptr-vector-coercion.ll
+6-5llvm/lib/Transforms/Utils/VNCoercion.cpp
+37-172 files

LLVM/project 178736d — llvm/test/Transforms/GVN ptr-vector-coercion.ll

[GVN] Pre-commit tests for forwarding pointer vectors of equal size
DeltaFile
+65-0llvm/test/Transforms/GVN/ptr-vector-coercion.ll
+65-01 files

LLVM/project cbd3d09 — 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 7af12b1 — clang/include/clang/StaticAnalyzer/Core/PathSensitive AnalysisManager.h, clang/lib/StaticAnalyzer/Checkers ArrayBoundChecker.cpp

[analyzer][NFC] Forward-declare Preprocessor in AnalysisManager.h (#235282)

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

    [20 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 deff29e — llvm/lib/Transforms/Utils VNCoercion.cpp, llvm/test/Transforms/GVN ptr-vector-coercion.ll

[GVN] Forward pointer vectors of equal size with `bitcast`

Claude-Session: https://claude.ai/code/session_01RggpUMzkFCnThxVbU7yKpj
DeltaFile
+31-13llvm/test/Transforms/GVN/ptr-vector-coercion.ll
+8-6llvm/lib/Transforms/Utils/VNCoercion.cpp
+39-192 files

LLVM/project ba1367d — llvm/test/Transforms/GVN ptr-vector-coercion.ll

[GVN] Pre-commit tests for forwarding pointer vectors of equal size

Claude-Session: https://claude.ai/code/session_01RggpUMzkFCnThxVbU7yKpj
DeltaFile
+65-0llvm/test/Transforms/GVN/ptr-vector-coercion.ll
+65-01 files

LLVM/project ff75cbe — llvm/lib/Transforms/Utils VNCoercion.cpp, llvm/test/Transforms/GVN pr14166.ll vector-poison.ll

[GVN] Keep `poison` per lane when forwarding vectors
DeltaFile
+48-63llvm/test/Transforms/GVN/pr63059.ll
+31-50llvm/test/Transforms/GVN/vector-poison.ll
+13-2llvm/lib/Transforms/Utils/VNCoercion.cpp
+0-1llvm/test/Transforms/GVN/pr14166.ll
+92-1164 files

LLVM/project 7c00dd7 — llvm/test/Transforms/GVN vector-poison.ll

[GVN] Pre-commit tests for per-lane `poison` in forwarded vectors
DeltaFile
+244-0llvm/test/Transforms/GVN/vector-poison.ll
+244-01 files

LLVM/project 585185e — llvm/lib/Transforms/IPO MemProfContextDisambiguation.cpp, llvm/test/ThinLTO/X86 memprof-funcassigncloning2.ll memprof-duplicate-context-ids2.ll

[MemProf] Use consistent trim vs prune terminology in comments (NFC) (#235336)

Throughout the MemProf code, the intention is that "trimming" refers to
removing the portion of an allocation context toward the root that is
not needed to distinguish cold from non-cold contexts, while "pruning"
refers to removing entire unneeded contexts (e.g. small unimportant
non-cold contexts). Several comments in MemProfContextDisambiguation and
a few tests incorrectly used "pruning" when referring to context
trimming. Update them to use "trimming" for consistency with
MemoryProfileInfo.

Assisted-by: Gemini
DeltaFile
+9-9llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
+4-4llvm/test/Transforms/MemProfContextDisambiguation/duplicate-context-ids2.ll
+4-4llvm/test/ThinLTO/X86/memprof-duplicate-context-ids2.ll
+2-2llvm/test/Transforms/MemProfContextDisambiguation/funcassigncloning2.ll
+2-2llvm/test/Transforms/MemProfContextDisambiguation/duplicate-context-ids.ll
+2-2llvm/test/ThinLTO/X86/memprof-funcassigncloning2.ll
+23-232 files not shown
+26-268 files

LLVM/project f0d0e58 — llvm/include/llvm/CodeGen/GlobalISel MIPatternMatch.h

[GlobalISel] Check binary flags before matching operands (#235451)

Reject instructions missing required flags before evaluating either
operand pattern in BinaryOp_match. This avoids unnecessary recursive
matching and output bindings for instructions that cannot match.

Assisted by: GPT 6.1-Sol
DeltaFile
+2-2llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
+2-21 files

LLVM/project 955aa73 — llvm/lib/Target/BPF BPFMIPeephole.cpp, llvm/test/CodeGen/BPF zext-elim-other-users.mir

[BPF] Keep mov and shift that have other users when removing a zext (#235210)

BPFMIPeephole replaces

  %2 = MOV_32_64 %1
  %3 = SLL_ri %2, 32
  %4 = SRL_ri %3, 32

with SUBREG_TO_REG when %1 is known to be zero extended, and erases all
three insns. %2 and %3 can have other users, which then read a register
that nothing defines: "Reading virtual register without a def" with
assertions, whatever the allocator picks without them.

Erase the mov and the left shift only when they have no other users

Co-authored-by: Alexei Starovoitov <ast at kernel.org>
DeltaFile
+46-0llvm/test/CodeGen/BPF/zext-elim-other-users.mir
+8-2llvm/lib/Target/BPF/BPFMIPeephole.cpp
+54-22 files

LLVM/project 3ec201c — llvm/test/Transforms/LoopInterchange perserve-lcssa.ll preserve-lcssa.ll

[LoopInterchange] Rename perserve-lcssa.ll and regenerate test checks (NFC) (#235476)

This patch fixes the followings:

- Fix typo in the filename (perserve -> preserve)
- Use UTC instead of hand written CHECKs

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+265-0llvm/test/Transforms/LoopInterchange/preserve-lcssa.ll
+0-209llvm/test/Transforms/LoopInterchange/perserve-lcssa.ll
+265-2092 files

LLVM/project 0479cde — 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 833e853 — 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 09c6bbf — 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 (#235281)

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.

    [13 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 61f4ce7 — llvm/lib/Transforms/Utils VNCoercion.cpp, llvm/test/Transforms/GVN pr14166.ll vector-poison.ll

[GVN] Keep poison per lane when forwarding vectors
DeltaFile
+48-63llvm/test/Transforms/GVN/pr63059.ll
+31-50llvm/test/Transforms/GVN/vector-poison.ll
+13-2llvm/lib/Transforms/Utils/VNCoercion.cpp
+0-1llvm/test/Transforms/GVN/pr14166.ll
+92-1164 files

LLVM/project 94d0845 — llvm/test/Transforms/GVN vector-poison.ll

[GVN] Pre-commit tests for per-lane poison in forwarded vectors
DeltaFile
+244-0llvm/test/Transforms/GVN/vector-poison.ll
+244-01 files

LLVM/project cfcd560 — lld/ELF ICF.cpp SyntheticSections.h

[ELF] Resolve the CIE of each FDE when splitting .eh_frame. NFC (#235492)

EhFrameSection::addRecords and iterateFDEWithinLSDA look up each FDE's
CIE by input offset in a DenseMap/DenseSet. Simplify by recording the
CIE's index in the same section when splitting it.

Narrow inputOff to uint32_t and reject .eh_frame input sections larger
than 4GiB as for MergeInputSection.
DeltaFile
+21-56lld/ELF/SyntheticSections.cpp
+15-5lld/ELF/InputSection.cpp
+8-5lld/ELF/InputSection.h
+2-7lld/ELF/SyntheticSections.h
+1-1lld/ELF/ICF.cpp
+47-745 files

LLVM/project 8ac857d — lldb/source/Symbol Symbol.cpp, lldb/unittests/Target ReExportedSymbolTest.cpp

[LLDB] Skip Undef Symbol when resolving ReExportedSymbol (#235387)

An undef symbol cannot be resolved. Skip it so that a symbol needs no
Resolve can pass. Without this, a symbol that needs no ReExport resolver
can choose the undef symbol incorrectly.

Assisted-by:    Claude # Test
DeltaFile
+56-0lldb/unittests/Target/ReExportedSymbolTest.cpp
+2-0lldb/source/Symbol/Symbol.cpp
+58-02 files

LLVM/project 21ef997 — llvm/lib/Target/M68k M68kSelectionDAGInfo.cpp M68kISelLowering.cpp

[M68k] Use MVT::i8 for CCR values.

This fixes some of the waivers in M68kSelectionDAGInfo.cpp. SUBX
is still broken for other reasons.
DeltaFile
+5-5llvm/lib/Target/M68k/M68kISelLowering.cpp
+1-7llvm/lib/Target/M68k/M68kSelectionDAGInfo.cpp
+6-122 files

LLVM/project 6ef2740 — llvm/lib/Target/X86 X86ISelLowering.cpp

[X86] Use X86::CondCode instead of unsigned. NFC (#235362)
DeltaFile
+2-2llvm/lib/Target/X86/X86ISelLowering.cpp
+2-21 files

LLVM/project 75c1240 — llvm/lib/Target/M68k M68kISelDAGToDAG.cpp M68kInstrArithmetic.td

[M68k] Remove dead ADDC/ADDE/SUBC/SUBE isel patterns. NFC (#235364)

These nodes are custom lowered and can't make it to isel.

Assisted-by: Claude
DeltaFile
+94-120llvm/lib/Target/M68k/M68kInstrArithmetic.td
+0-1llvm/lib/Target/M68k/M68kISelDAGToDAG.cpp
+94-1212 files

LLVM/project b33a19c — llvm/lib/Target/M68k M68kISelLowering.cpp

[M68k] Use M68k::CondCode instead of unsigned. NFC (#235359)
DeltaFile
+11-11llvm/lib/Target/M68k/M68kISelLowering.cpp
+11-111 files

LLVM/project 7bfd15e — clang/test/CodeGen/RISCV rvp-intrinsics.c, cross-project-tests/intrinsic-header-tests riscv_packed_simd.c

[RISCV][P-ext] Test cleanup and improvements. NFC (#235322)

-Use script to generate pnclip tests in rvp-intrinsics.c
-Add missing pnclip tests to riscv_packed_simd.c
-Add missing tests to rvp-intrinsics.c
DeltaFile
+2,335-48clang/test/CodeGen/RISCV/rvp-intrinsics.c
+72-0cross-project-tests/intrinsic-header-tests/riscv_packed_simd.c
+2,407-482 files

LLVM/project 2cc8fc8 — llvm/test/Transforms/SLPVectorizer/RISCV long-gep-chains.ll

[SLP] Add +m to long-gep-chains.ll (#235404)

To recover test fidelity after the changes in
7e2f1c5914cf524d1ae36f555d0fa78ab60484de.
DeltaFile
+15-13llvm/test/Transforms/SLPVectorizer/RISCV/long-gep-chains.ll
+15-131 files

LLVM/project a7ed768 — llvm/test/TableGen InstRegexPrefixes.td, llvm/utils/TableGen/Common CodeGenSchedule.cpp

TableGen: Narrow instregex matching to leading literal alternatives

instregex ran the regex on every instruction if a pattern had no literal
prefix, even when it started with literal alternatives like ^(S|U)CVTF
or [SU]ABD. Search for each prefix those allow, here SCVTF and UCVTF,
and keep the original instruction order. Add a test for which patterns
get prefixes.

AArch64GenSubtargetInfo.inc tablegen run:

            Gigainstructions  Gigacycles      CPU seconds
  Before    43.1              17.8            5.4
  After     29.0 (-32.6%)     12.0 (-32.5%)   3.7 (-31.4%)

All 366 tablegen runs in an LLVM build with all targets, together with
the previous change to keep the prefix for patterns with a top-level ?:

            Gigainstructions  Gigacycles      CPU seconds
  Before    2189              1380            489

    [3 lines not shown]
DeltaFile
+115-0llvm/test/TableGen/InstRegexPrefixes.td
+87-8llvm/utils/TableGen/Common/CodeGenSchedule.cpp
+202-82 files

LLVM/project 2bdf62d — llvm/utils/TableGen/Common CodeGenSchedule.cpp

TableGen: Keep the instregex prefix for patterns with a top-level ?

instregex discarded a pattern's literal prefix, and ran the regex on
every instruction, if the pattern had a ? outside parentheses, as in
LDPS?Wi. A ? only makes the atom before it optional, and an atom
directly before it is already dropped from the prefix. Only a top-level
| makes the prefix unusable.

AArch64GenSubtargetInfo.inc tablegen run:

            Gigainstructions  Gigacycles      CPU seconds
  Before    44.6              18.8            5.7
  After     43.1 (-3.4%)      17.8 (-4.9%)    5.4 (-4.6%)

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+3-2llvm/utils/TableGen/Common/CodeGenSchedule.cpp
+3-21 files

LLVM/project fd82458 — flang/lib/Evaluate host.h

Assume std::string to be the native type
DeltaFile
+1-1flang/lib/Evaluate/host.h
+1-11 files

LLVM/project 178aea6 — llvm/utils/TableGen/Common CodeGenSchedule.cpp

TableGen: Match each instregex pattern only once

Scheduling models use the same instregex patterns many times, and every
use matched the pattern against the instruction names again. AArch64
evaluates 12501 patterns, only 4344 of them distinct, for a total of 34
million regex matches. Cache the instructions each pattern matches, so a
repeated pattern costs a lookup.

AArch64GenSubtargetInfo.inc tablegen run:

            Gigainstructions  Gigacycles      CPU seconds
  Before    67.9              31.1            9.4
  After     44.6 (-34.3%)     18.8 (-39.6%)   5.7 (-39.1%)

All 366 tablegen runs in an LLVM build with all targets:

            Gigainstructions  Gigacycles      CPU seconds
  Before    2252              1409            499
  After     2188 (-2.8%)      1380 (-2.1%)    489 (-1.9%)

    [2 lines not shown]
DeltaFile
+17-11llvm/utils/TableGen/Common/CodeGenSchedule.cpp
+17-111 files