LLVM/project 21a6608 — llvm/lib/MCA/HardwareUnits Scheduler.cpp, llvm/lib/Target/ARM ARMScheduleA9.td

[llvm-mca][ARM] Fix Cortex-A9 dispatch hazards and NEON memory resources (#230454)

Fix the Cortex-A9 llvm-mca crash by checking execution-resource
availability for instructions that must issue immediately.

Restore NEON structure load/store resource pressure by using the
existing `ItinRW` mappings instead of resource-free `SchedRW` entries.

Add regression tests for the dispatch hazard, original crash reproducer,
and NEON load/store resource pressure.

Fixes #225087.
DeltaFile
+89-0llvm/test/tools/llvm-mca/ARM/cortex-a9-neon-structure-ldst.s
+81-0llvm/test/tools/llvm-mca/ARM/cortex-a9-dispatch-hazard.s
+27-33llvm/lib/Target/ARM/ARMScheduleA9.td
+24-0llvm/test/tools/llvm-mca/ARM/cortex-a9-neon-crash.s
+8-0llvm/lib/MCA/HardwareUnits/Scheduler.cpp
+229-335 files

LLVM/project 4a9276a — llvm/lib/Target/DirectX DXILContainerGlobals.cpp, llvm/lib/Target/DirectX/DXILWriter DXILWriterPass.cpp

[DirectX] Declare command line options in TableGen (#234865)

Move the options into MCTargetDesc/DirectXMCOptions.td, since the object
writer reads them too. The asm backend hands them from MCTargetOptions
to the object writer; the passes read them from the module's
LLVMContext.

-disable-dxil-remove-unused-resources is renamed to
-dx-remove-unused-resources, with the old spelling kept as an alias.

Aided by Opus 5.5
DeltaFile
+34-0llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCOptions.td
+10-19llvm/lib/Target/DirectX/MCTargetDesc/DirectXContainerObjectWriter.cpp
+12-16llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp
+24-0llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCOptions.h
+9-14llvm/lib/Target/DirectX/DXILContainerGlobals.cpp
+11-4llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp
+100-5324 files not shown
+135-10130 files

LLVM/project 3d183e6 — llvm/docs ReleaseNotes.md, llvm/lib/Target/ARM CMakeLists.txt ARM.h

[ARM] Trap after a noreturn call that ends a function or funclet on Windows (#242026)

On Windows the unwinder finds the function or funclet of a frame from
its return address. When a noreturn call is the last instruction of a
function or funclet, the return address is the start of the next one. With
C++ EH (#240693), MSVC's runtime then catches a rethrow from the
end of a catch funclet again and again until the stack overflows. I hit
this running Kodi's exception tests on a Surface RT.

MSVC puts a `__debugbreak` after these calls. This adds a pass that puts
a trap there. AArch64 does this in its AsmPrinter (#232358), but on ARM
blocks can't grow after ARMConstantIslands, so the pass runs before it.

Assisted-by: Claude Opus 5.5 (Anthropic)
DeltaFile
+82-4llvm/test/CodeGen/ARM/Windows/trap-unreachable.ll
+73-0llvm/lib/Target/ARM/ARMAvoidTrailingCall.cpp
+5-0llvm/lib/Target/ARM/ARMTargetMachine.cpp
+3-0llvm/docs/ReleaseNotes.md
+2-0llvm/lib/Target/ARM/ARM.h
+1-0llvm/lib/Target/ARM/CMakeLists.txt
+166-46 files

LLVM/project fe2720f — llvm/lib/Target/ARM ARMConstantIslandPass.cpp, llvm/test/CodeGen/ARM/Windows funclet-align.ll

[ARM] Count the funclet entry alignment in ARMConstantIslands (#242153)

WinException aligns each funclet entry to the function's preferred
alignment, which is 4 once ARMConstantIslands has placed a
constant pool or found a Thumb-2 jump table. ARMConstantIslands
didn't count that padding, so in a function with many funclets a
constant pool load could end up out of range, and the assembler
stopped with "out of range pc-relative fixup value". I hit this building
Kodi for Windows on Arm: a vldr ended up 1032 bytes from its
pool, behind 38 bytes of funclet padding.

This gives funclet entries that alignment once it is final, and updates
the block offsets.

Assisted-by: Claude Opus 5.5 (Anthropic)
DeltaFile
+91-0llvm/test/CodeGen/ARM/Windows/funclet-align.ll
+13-0llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+104-02 files

LLVM/project 2c38d37 — lld/COFF Writer.cpp, lld/test/COFF cgprofile-same-name.s

[LLD][COFF] Make the call graph profile sort deterministic (#240563)

sortSections copied the call graph priorities into ctx.config.order,
which is keyed by symbol name. When two sections had leaders
with the same name, for example static functions with the same
name in different files, both got the priority of whichever came
last in a map keyed by pointers. So the layout could change
between two links of the same inputs. Sort by each section's
own priority instead.

Assisted-by: Claude Opus 5.5 (Anthropic)
DeltaFile
+43-0lld/test/COFF/cgprofile-same-name.s
+16-9lld/COFF/Writer.cpp
+59-92 files

LLVM/project a148afa — lld/COFF Writer.cpp, lld/test/COFF arm64-thunks-same-chunk.s arm-thumb-thunks-same-chunk.s

[LLD][COFF] Don't thunk an in-range branch within one section (#240564)

createThunks gives a branch a range extension thunk when it is out of
range with a safety margin, and the margin grows when a pass fails. A
branch to a target in its own section chunk got one too, although its
distance can't change: thunks are only placed between chunks. The
thunk clobbers r12 on ARM (x16 on ARM64) in the middle of a function.
MSVC's __rt_sdiv keeps a value in r12 across such a branch, so its
remainders came back with the wrong sign. Check these branches
without the margin.

Assisted-by: Claude Opus 5.5 (Anthropic)
DeltaFile
+39-0lld/test/COFF/arm-thumb-thunks-same-chunk.s
+36-0lld/test/COFF/arm64-thunks-same-chunk.s
+8-0lld/COFF/Writer.cpp
+83-03 files

LLVM/project a337fd0 — lldb/include/lldb/Interpreter OptionGroupLanguageExpression.h, lldb/source/Commands CommandObjectExpression.h CommandObjectExpression.cpp

[lldb] Let language plugins add options to the expression command (#244453)

This patch adds a new mechanism so Language plugins can reguster their
own options with the expression and dwim-print commands and add them to
EvaluateExpressionOptions. It moves --c++-ignore-context-qualifiers from
the expression command into the C++ plugin.

Assisted-by: Claude
DeltaFile
+44-0lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+23-6lldb/source/Commands/CommandObjectExpression.cpp
+28-0lldb/include/lldb/Interpreter/OptionGroupLanguageExpression.h
+20-0lldb/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
+11-0lldb/source/Plugins/Language/CPlusPlus/LanguageCPlusPlusOptions.td
+9-1lldb/source/Commands/CommandObjectExpression.h
+135-77 files not shown
+156-1413 files

LLVM/project e4d1f5f — llvm/lib/Transforms/Scalar GVN.cpp, llvm/test/Transforms/GVN metadata.ll

fixup! [GVN] Merge metadata from values to load
DeltaFile
+25-11llvm/lib/Transforms/Scalar/GVN.cpp
+29-5llvm/test/Transforms/GVN/metadata.ll
+54-162 files

LLVM/project 64425ba — llvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/CodeGen/ARM bf16-instructions.ll

Merge branch 'main' into users/zero9178/nvvm-dialect-op-partitions
DeltaFile
+2,062-0llvm/test/Transforms/SLPVectorizer/X86/sese-region-non-schedulable-cost.ll
+1,158-246llvm/include/llvm/IR/RuntimeLibcalls.td
+1,247-2llvm/test/Transforms/SLPVectorizer/X86/sese-region-non-schedulable.ll
+1,026-142llvm/test/CodeGen/ARM/bf16-instructions.ll
+930-0llvm/test/CodeGen/SystemZ/pdep-pext.ll
+312-542llvm/test/CodeGen/Mips/msa/basic_operations.ll
+6,735-9322,027 files not shown
+52,370-26,6952,033 files

LLVM/project 18867a5 — llvm/lib/Target/AArch64 MachineSMEABIPass.cpp AArch64InstrInfo.cpp

[AArch64] Remove write-only and unused members (NFC) (#245006)

AArch64PipelinerLoopInfo::TRI: Added on June 12, 2024 in commit
0c5319e546321d7a766999e49e0ccf801ff2b3dc without any readers.  This
patch also removes its initializer.

AArch64StackTaggingPreRAImpl::TRI: Added on August 30, 2019 in commit
04647f5e222b21b9ff178abf77fbdcb4577a7979 without any readers.  This
patch also removes its assignment.

MachineSMEABI::emitSetupFullZASave: This declaration was added on
September 9, 2025 in commit 96d556784ed3ec7a8a6c377b44afb5dfa49229e6
without a definition or any callers.

Assisted-by: Antigravity
DeltaFile
+2-4llvm/lib/Target/AArch64/AArch64StackTaggingPreRA.cpp
+1-3llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+0-3llvm/lib/Target/AArch64/MachineSMEABIPass.cpp
+3-103 files

LLVM/project 3fc9a86 — llvm/lib/Target TargetMachine.cpp

[X86] Check global size before section kind in isLargeGlobalValue (NFC) (#237015)

Checking a global's section kind can walk its entire initializer,
whereas
checking its size is cheap.

Part of #236952.

Assisted-by: Gemini
DeltaFile
+6-2llvm/lib/Target/TargetMachine.cpp
+6-21 files

LLVM/project 7e6c19d — llvm/lib/Analysis LoopAccessAnalysis.cpp, llvm/test/Analysis/LoopAccessAnalysis invariant-stores-constant-distance.ll

[LAA] Find no dependence between invariant accesses a constant distance apart

Two loop-invariant accesses whose addresses differ by a constant overlap
in every iteration or in none, even if the addresses wrap. LAA showed
they were disjoint only when one ended exactly where the other began,
or when it could prove the addresses do not wrap. Otherwise it reported
an unknown dependence and gave up on the loop, so a loop that updates
three or more fields of a struct through a pointer was not vectorized:

  struct trio { int a, b, c; };
  void acc3(struct trio *p, const int *x, int n) {
    for (int i = 0; i < n; i++) {
      p->a += x[i];
      p->b ^= x[i];
      p->c |= x[i];
    }
  }

This now vectorizes on x86-64 (VF 4, interleaved by 2). 200000 calls on

    [5 lines not shown]
DeltaFile
+4-24llvm/test/Analysis/LoopAccessAnalysis/invariant-stores-constant-distance.ll
+15-4llvm/lib/Analysis/LoopAccessAnalysis.cpp
+19-282 files

LLVM/project 470178e — llvm/test/Analysis/LoopAccessAnalysis invariant-stores-constant-distance.ll

[LAA] Precommit test for invariant accesses a constant distance apart (NFC)

Assisted-by: Claude Code
DeltaFile
+317-0llvm/test/Analysis/LoopAccessAnalysis/invariant-stores-constant-distance.ll
+317-01 files

LLVM/project 2252e5d — llvm/lib/Transforms/Vectorize VPlanUtils.h LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize expand-scev-cse.ll

[VPlan] Don't drop poison-generating flags while building VPlans (#245029)

VPSCEVExpander::tryToReuseIRValue dropped poison-generating flags from
reused IR values right away, modifying the IR even if the plan is
discarded. Prefer values that don't need flags dropped, and otherwise
create an in-IR VPExpandSCEVRecipe, leaving it to SCEVExpander instead.

Such recipes may now only be in the epilogue plan, so don't assert they
were expanded for the main plan.
DeltaFile
+55-0llvm/test/Transforms/LoopVectorize/expand-scev-cse.ll
+10-5llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+5-4llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+2-3llvm/test/Transforms/LoopVectorize/X86/cleanup-runtime-checks.ll
+3-2llvm/lib/Transforms/Vectorize/VPlanUtils.h
+75-145 files

LLVM/project d00f92f — llvm/test/tools/llubi lib_memcpy_overlap.ll lib_memcpy_same_pointer.ll, llvm/tools/llubi/lib Library.cpp ExecutorBase.cpp

[llubi] Add support for memcpy/memmove/memset (#245021)

This patch adds support for memcpy/memmove/memset libcalls. Unlike LLVM
intrinsics, passing null pointers or invalid pointers is UB, even if the
length is zero. Calling memcpy w/ equal src and dest pointers is also
UB.

Aided by DeepSeek-V4.1-Flash-1017.
DeltaFile
+118-0llvm/test/tools/llubi/lib_memory_ops.ll
+6-111llvm/tools/llubi/lib/Interpreter.cpp
+103-0llvm/tools/llubi/lib/ExecutorBase.cpp
+23-0llvm/tools/llubi/lib/Library.cpp
+19-0llvm/test/tools/llubi/lib_memcpy_same_pointer.ll
+18-0llvm/test/tools/llubi/lib_memcpy_overlap.ll
+287-1116 files not shown
+322-11512 files

LLVM/project cb9040e — llvm/lib/Target/Hexagon HexagonDepIICScalar.td, llvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll

Rebase, improvements

Created using spr 2.0.0-beta.1
DeltaFile
+19,530-19,493llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+29,293-0llvm/test/CodeGen/X86/vector-interleave7-i16.ll
+29,228-0llvm/test/CodeGen/X86/vector-interleaved7-i8.ll
+15,508-13,586llvm/lib/Target/Hexagon/HexagonDepIICScalar.td
+27,225-0llvm/test/CodeGen/X86/vector-interleave7-i32.ll
+26,140-0llvm/test/CodeGen/X86/vector-deinterleave7-i8.ll
+146,924-33,07922,984 files not shown
+1,808,098-516,31422,990 files

LLVM/project f2297b4 — libcxx/include/__random subtract_with_carry_engine.h, libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub seed_result_type.pass.cpp

[libc++][random] Implement LWG 3809 and LWG 4014 (#239844)

Summary:
- Implement LWG 3809 by correcting the seed initialization of
`std::subtract_with_carry_engine` for narrow result types.
- Implement LWG 4014 by reducing seed values modulo `2147483563` before
conversion to `uint_least32_t`, preserving the intended behavior for
wider result types.
- Add regression tests covering both defect reports.

Testing:
-
`libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/seed_result_type.pass.cpp`
DeltaFile
+59-2libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/seed_result_type.pass.cpp
+6-5libcxx/include/__random/subtract_with_carry_engine.h
+65-72 files

LLVM/project 8bf10a1 — llvm/lib/Target/AMDGPU SIInsertWaitcnts.cpp, llvm/test/CodeGen/AMDGPU extract-subvector-16bit.ll flat-saddr-atomics.ll

[AMDGPU] Keep soft waitcnts unchanged until SIInsertWaitcnts converges

On the first visit to a loop header only the preheader state is known.
A soft waitcnt there (e.g. from a release fence) can have some of its
counters simplified away while another counter keeps the instruction
alive: the fence's own vmcnt(0), a preceding wait.asyncmark, or an
explicit s_waitcnt. The soft waitcnt was then rewritten with the
simplified value and promoted to a hard waitcnt, or merged into a
preceding hard one. When the back edge later brought a pending LDS
store, the original lgkmcnt(0) request was gone, and the s_barrier after
the release fence no longer waited for it.

Treat soft waitcnts as requests that depend on the incoming state: never
merge, promote or rewrite them while the analysis iterates. They are
kept unchanged in DeferredErasures, a hard waitcnt (existing or new)
carries what is needed on each visit, and the soft waitcnts are erased
once the analysis converges. This extends #220357, which did the same
only for soft waitcnts that were simplified away entirely.


    [11 lines not shown]
DeltaFile
+66-66llvm/test/CodeGen/AMDGPU/function-args.ll
+48-48llvm/test/CodeGen/AMDGPU/a-v-flat-atomicrmw.ll
+32-32llvm/test/CodeGen/AMDGPU/flat-saddr-atomics.ll
+12-11llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+10-10llvm/test/CodeGen/AMDGPU/extract-subvector-16bit.ll
+10-10llvm/test/CodeGen/AMDGPU/GlobalISel/flat-scratch.ll
+178-17712 files not shown
+221-21618 files

LLVM/project 12269c8 — clang/test/CodeGen/AArch64/sve rintn.c rintp.c, clang/test/CodeGen/AArch64/sve-intrinsics acle_sve_rintp.c acle_sve_rintn.c

Reland "[clang][CIR] Add tests for SVE RINT{N,P} intrinsics" (#244954)

This relands #241220 and #241236, which were reverted in #244680.

Since AArch64 call conv lowering, which is now the default since
#244014, doesn't have support for SVE, this does the migration with
`-fno-clangir-call-conv-lowering`, which allows these tests to avoid
call conv lowering.
DeltaFile
+190-0clang/test/CodeGen/AArch64/sve/rintn.c
+190-0clang/test/CodeGen/AArch64/sve/rintp.c
+0-176clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_rintp.c
+0-176clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_rintn.c
+380-3524 files

LLVM/project ee37fee — llvm/lib/Transforms/Scalar LoopInterchange.cpp, llvm/test/Transforms/LoopInterchange pr57148.ll loop-metadata.ll

[LoopInterchange] Interchange loops by remapping induction variables

This is the main part of #235496. Before this patch, interchanging the
loops was achieved by splitting BBs and rewiring PHIs and branches.
This method is complicated and has caused several bugs. This patch
changes the way to achieve interchange so that the original CFG is kept
as it is. Instead of changing the control flow, this patch interchanges
the loops by using the counter of each loop to make it run as many
iterations as the other loop did, and by swapping IV-related variables
between the outer and inner loops. Also, in addition to simplifying the
logic, this approach doesn't create new BBs unlike the previous method,
so the generated IR is relatively clean.

The existing legality checks already rule out most of the loops to
which this transformation cannot be applied, so most of the changes are
confined to the transformation phase. The legality checks are changed
as follows:

- Loops where a branch before the inner loop depends on the outer IVs

    [11 lines not shown]
DeltaFile
+225-614llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+128-216llvm/test/Transforms/LoopInterchange/fp-reductions.ll
+112-189llvm/test/Transforms/LoopInterchange/reductions-non-wrapped-operations.ll
+87-146llvm/test/Transforms/LoopInterchange/freeze.ll
+69-124llvm/test/Transforms/LoopInterchange/loop-metadata.ll
+57-104llvm/test/Transforms/LoopInterchange/pr57148.ll
+678-1,39350 files not shown
+1,825-3,35656 files

LLVM/project 54ae5a0 — llvm/test/Transforms/LoopInterchange loop-control-available-in-outer-preheader.ll

Reapply "[LoopInterchange] Add tests for loop control values in the outer preheader (NFC)" (#235520)

This reverts commit 063d4816ce9051924a61f5d1e31a05992ca221b8.

Add test cases where it matters whether the loop control values (the
initial and final values of the IVs) are available in the outer loop
preheader. These are corner cases where the work in #235496 changes
what loop-interchange can handle.

The original commit was reverted because one of the tests failed with
EXPENSIVE_CHECKS due to stale SCEV dispositions (#221571). This has
been fixed by #222175 (not yet, but it will be). This reapply also adds
-verify-scev to the RUN line so that the issue is caught without
EXPENSIVE_CHECKS.

Part of #235496

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+126-0llvm/test/Transforms/LoopInterchange/loop-control-available-in-outer-preheader.ll
+126-01 files

LLVM/project cd14e75 — llvm/lib/Transforms/Scalar LoopInterchange.cpp, llvm/test/Transforms/LoopInterchange loop-metadata.ll inner-latch-lcssa-feeds-exit-condition.ll

[LoopInterchange] Replace exit conditions of interchanged loops with counters

In the transformation phase of LoopInterchange, the exit condition of
the inner loop is reused by cloning the instructions involved in it and
moving them into a new BB. Handling all PHI nodes correctly in this way
is difficult, and it has caused several bugs.

Instead, this patch introduces a new way to control the interchanged
loops: add a new variable that works just as a loop counter, and compute
the exit condition from it and the original BTC. The induction variables
that were used only to compute the original exit conditions are deleted.
This makes the logic simpler, since the computation of the original exit
condition no longer needs to be moved.

Part of #235496

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+101-2llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+64-24llvm/test/Transforms/LoopInterchange/fp-reductions.ll
+56-21llvm/test/Transforms/LoopInterchange/reductions-non-wrapped-operations.ll
+42-23llvm/test/Transforms/LoopInterchange/freeze.ll
+36-25llvm/test/Transforms/LoopInterchange/inner-latch-lcssa-feeds-exit-condition.ll
+42-17llvm/test/Transforms/LoopInterchange/loop-metadata.ll
+341-11249 files not shown
+998-42855 files

LLVM/project 41289ca — llvm/lib/Transforms/Scalar LoopInterchange.cpp, llvm/test/Transforms/LoopInterchange induction-variable-update.ll loop-control-available-in-outer-preheader.ll

[LoopInterchange] Require loop control values to be expandable in the outer preheader

This patch slightly changes the legality check in preparation for later
patches. Specifically:

- Loops whose inner IVs have initial values that are outer loop
  invariant but neither constants nor instructions (e.g., function
  arguments) become interchange candidates.
- Loops where the BTC of the inner loop is computed inside the outer
  loop (more precisely, cannot be expanded in the outer loop preheader)
  are no longer candidates.

As far as I tried, this change doesn't affect most cases.

Part of #235496

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+58-28llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+27-25llvm/test/Transforms/LoopInterchange/loop-control-available-in-outer-preheader.ll
+21-10llvm/test/Transforms/LoopInterchange/induction-variable-update.ll
+106-633 files

LLVM/project a9ed3fc — llvm/lib/Transforms/Utils LoopUnroll.cpp, llvm/test/Transforms/LoopUnroll partial-unroll-reductions.ll

[LoopUnroll] Drop poison-generating annotations on parallel reductions (#245038)

For min/max reductions we need to drop range attributes as well.

Fixes #245027.
DeltaFile
+111-0llvm/test/Transforms/LoopUnroll/partial-unroll-reductions.ll
+1-1llvm/lib/Transforms/Utils/LoopUnroll.cpp
+112-12 files

LLVM/project 8f10fe5 — mlir/lib/Dialect/Linalg/Transforms Vectorization.cpp, mlir/test/Dialect/Linalg/vectorization linalg-ops.mlir

[mlir][linalg][vector] Mark transfers in-bounds when no mask is needed (#244179)

Update `VectorizationState::maskOperation` to set `in_bounds` to `true`
when the vectorizer determines that no mask is required for an XFer
op because its accesses are guaranteed to be in-bounds.

This effectively reverses the change made in #160839.

Part of: https://github.com/llvm/llvm-project/issues/227821
DeltaFile
+14-35mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
+9-7mlir/test/Dialect/Linalg/vectorization/linalg-ops.mlir
+23-422 files

LLVM/project 661d5a4 — llvm/lib/Transforms/Scalar LoopInterchange.cpp

address review
DeltaFile
+4-1llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+4-11 files

LLVM/project 0ecb918 — llvm/lib/Target/AMDGPU AMDGPUTargetTransformInfo.h AMDGPUTargetTransformInfo.cpp, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.h AMDGPUBaseInfo.cpp

[ThinLTO][AMDGPU] Implement `TTI::getCallTypeId()`

We want to propagate attributes along the call graph at the thin link to enable
better code generation for each module. This requires a precise call graph.
ThinLTO supports call type IDs for indirect function calls, and this PR enables
that support for AMDGPU.

To maintain consistency with object linking, we need to use the same rules for
computing call type IDs, even though they might be a little less precise at the
IR level.

This PR was assisted by AI but I reviewed all the changes.
DeltaFile
+139-0llvm/test/ThinLTO/AMDGPU/call-type-ids.ll
+2-34llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+32-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+11-0llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+10-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+3-0llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
+197-346 files

LLVM/project b5cf477 — llvm/docs LangRef.md, llvm/include/llvm/IR ModuleSummaryIndex.h

[ThinLTO] Add call type IDs to function summaries

The thin link doesn't know which functions an indirect call can reach, so any
analysis at the thin link must treat every indirect call as a call to unknown
code.

To enable more precise call graph analysis at the thin link, we need to narrow
down the set of functions that an indirect call can reach.

This PR adds call type IDs to function summaries. A call type ID is a 64-bit
hash of a function signature, computed by the target through the new
`TTI::getCallTypeId()` hook. A function can only be a potential target of an
indirect call if its type ID matches that of the indirect call.

The hook returns `std::nullopt` by default to preserve the existing behavior for
other targets. As a result, we need to use a unit test with a dummy test target
to verify the summary builder.

This PR was assisted by AI but I reviewed all the changes.
DeltaFile
+188-0llvm/unittests/Analysis/ModuleSummaryAnalysisTest.cpp
+64-3llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+62-2llvm/lib/AsmParser/LLParser.cpp
+30-3llvm/docs/LangRef.md
+32-0llvm/include/llvm/IR/ModuleSummaryIndex.h
+22-0llvm/test/Assembler/thinlto-call-type-ids-summary.ll
+398-814 files not shown
+496-920 files

LLVM/project b8035d8 — clang/test/CodeGenCXX likely-module-local-template-args.cpp

Add tests for likely_module_local with compound types and nested template specializations
DeltaFile
+49-2clang/test/CodeGenCXX/likely-module-local-template-args.cpp
+49-21 files

LLVM/project eda7a83 — clang/include/clang/Basic CodeGenOptions.def, clang/include/clang/Options Options.td

[Clang] Mark template instantiations with main-file template arguments as likely_module_local

With -fmodule-local-hints, Clang marks inline functions and template
instantiations defined in the main source file as likely_module_local. A
template defined in a header but instantiated with an entity declared in the
main file (e.g. std::sort with a main-file comparator or lambda) isn't marked,
even though such an instantiation can't be referenced or emitted by any other
translation unit either.

Also mark a function template instantiation if its template arguments, or
those of the enclosing class and function template specializations, name a
class, enum, lambda closure type, function or template declared in the main
file. Pointer, reference, array, member pointer and function types are looked
through, as are the template arguments of class template specializations used
as arguments. The walk is bounded to avoid blowup on deeply nested arguments.
DeltaFile
+89-2clang/lib/CodeGen/CodeGenModule.cpp
+63-0clang/test/CodeGenCXX/likely-module-local-template-args.cpp
+2-4clang/test/CodeGenCXX/likely-module-local.cpp
+2-1clang/include/clang/Options/Options.td
+2-1clang/include/clang/Basic/CodeGenOptions.def
+158-85 files