LLVM/project 35f0413 — llvm/include/llvm/CodeGen SlotIndexes.h, llvm/lib/CodeGen RegAllocGreedy.cpp LiveIntervals.cpp

[CodeGen] Drop dead SlotIndexes before allocation

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.
DeltaFile
+288-0llvm/unittests/CodeGen/SlotIndexesTest.cpp
+43-0llvm/lib/CodeGen/SlotIndexes.cpp
+32-0llvm/test/CodeGen/AMDGPU/greedy-compact-slot-indexes.ll
+23-6llvm/include/llvm/CodeGen/SlotIndexes.h
+17-0llvm/lib/CodeGen/LiveIntervals.cpp
+12-1llvm/lib/CodeGen/RegAllocGreedy.cpp
+415-71 files not shown
+419-77 files

LLVM/project da1ff2f — llvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU inline-asm-16bit-physreg-no-true16-err.ll

AMDGPU: Reject 16-bit physical register inline asm constraints without true16 (#235063)

Constraints naming 16-bit physical registers such as {v1.l}, {v1.h},
{s1.l} or {a1.l} were accepted on subtargets without true16, which
then hit an assertion in copyPhysReg. Report the constraint as
unallocatable instead.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+58-0llvm/test/CodeGen/AMDGPU/inline-asm-16bit-physreg-no-true16-err.ll
+5-1llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+63-12 files

LLVM/project e13668a — llvm/lib/Target/WebAssembly WebAssemblyTargetMachine.cpp WebAssemblyLowerEmscriptenEHSjLj.cpp, llvm/test/CodeGen/WebAssembly eh-option-errors.ll

WebAssembly: Use reportFatalUsageError for eh option errors (#233031)

Avoid using the deprecated report_fatal_error, and add missing
error test coverage.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+32-8llvm/test/CodeGen/WebAssembly/eh-option-errors.ll
+6-6llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
+1-1llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+39-153 files

LLVM/project 4024d04 — flang/include/flang/Evaluate fold.h, flang/lib/Evaluate character-value-impl.cpp

clang-format with recent clang-format
DeltaFile
+17-18flang/lib/Evaluate/character-value-impl.cpp
+2-2flang/include/flang/Evaluate/fold.h
+19-202 files

LLVM/project 0fcb5f8 — llvm/docs AMDGPUUsage.rst, llvm/test/CodeGen/NVPTX store-sm60.ll load-sm70.ll

Merge branch 'flangast-main' into users/meinersbur/flang_KIND-detemplatization
DeltaFile
+22,584-0llvm/test/CodeGen/NVPTX/load-sm90.ll
+0-22,228llvm/docs/AMDGPUUsage.rst
+21,644-0llvm/test/CodeGen/NVPTX/store-sm90.ll
+20,068-0llvm/test/CodeGen/NVPTX/load-sm60.ll
+19,684-0llvm/test/CodeGen/NVPTX/load-sm70.ll
+19,088-0llvm/test/CodeGen/NVPTX/store-sm60.ll
+103,068-22,2282,726 files not shown
+266,043-74,1542,732 files

LLVM/project 9620483 — llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG profile-regression.ll

[SimplifyCFG] Fix profiles in hoistCommonCodeFromSuccessors (#234833)

We cannot keep branch weights here given the select condition/control
flow condition we're hoisting across might be dependent.

Found in a bootstrapping build of LLVM with -mllvm
-enable-profcheck-in-pipeline.
DeltaFile
+19-0llvm/test/Transforms/SimplifyCFG/profile-regression.ll
+6-0llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+25-02 files

LLVM/project 03cf774 — llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG preserve-branchweights-switch-create.ll

[SimplifyCFG] Propagate unknown profiles in performValueComparisonIntoPredecessorFolding (#234827)

Otherwise we get profcheck verification failures as the verifier assumes
we just did not handle this case.

This came up in a bootstrapping build of LLVM with -mllvm
-enable-profcheck-in-pipeline.
DeltaFile
+51-0llvm/test/Transforms/SimplifyCFG/preserve-branchweights-switch-create.ll
+2-0llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+53-02 files

LLVM/project bb87bbe — llvm/lib/Transforms/Utils SimplifyIndVar.cpp, llvm/test/Transforms/IndVarSimplify urem-to-select-pgo.ll

[IndVars] Synthesize profile information for urem->select folding (#231990)

In these cases we can derive the profile information from the loop trip
count assuming a couple of assumptions are met.
DeltaFile
+200-0llvm/test/Transforms/IndVarSimplify/urem-to-select-pgo.ll
+31-0llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+0-3llvm/utils/profcheck-xfail.txt
+231-33 files

LLVM/project 60c4a1e — llvm/lib/Transforms/IPO MemProfContextDisambiguation.cpp, llvm/test/Transforms/MemProfContextDisambiguation matching-calls.ll mergenodes-matching-calls.ll

[MemProf] Fix remapping of matching calls when assigning function clones

When a function has several calls with identical callsite metadata, they
are recorded on one context node with the extra calls in
Node->MatchingCalls. If that function is cloned by context
disambiguation, assignFunctions must remap each version's matching calls
through the function clone's CallMap, the same way it remaps the primary
Call.

Two problems in the IR path:

* AssignCallsiteCloneToFuncClone rewrote the matching calls of the
  original node (Node->MatchingCalls) instead of those of the callsite
  clone being assigned. The clone node (whose MatchingCalls were copied
  from the original at creation) kept the original instructions, and the
  original node's list was overwritten with the clone's. UpdateCalls then
  updated each function version's matching calls with the other version's
  callee clone, i.e. swapped.


    [16 lines not shown]
DeltaFile
+193-0llvm/test/Transforms/MemProfContextDisambiguation/mergenodes-matching-calls.ll
+41-29llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
+54-0llvm/test/Transforms/MemProfContextDisambiguation/matching-calls.ll
+288-293 files

LLVM/project 4b8b3c7 — llvm/lib/Target/PowerPC PPCInstrInfo.cpp, llvm/test/CodeGen/PowerPC convert-rr-to-ri-instrs.mir convert-rr-to-ri-instrs-out-of-range.mir

PowerPC: Stop adding kill flags when promoting instructions to 64-bit

Continue purging kill flags from virtual register cases

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+5-5llvm/test/CodeGen/PowerPC/sext_elimination.mir
+5-5llvm/test/CodeGen/PowerPC/peephole-replaceInstr-after-eliminate-extsw.mir
+1-2llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
+1-1llvm/test/CodeGen/PowerPC/convert-rr-to-ri-instrs.mir
+1-1llvm/test/CodeGen/PowerPC/convert-rr-to-ri-instrs-out-of-range.mir
+13-145 files

LLVM/project 6ced0ee — llvm/lib/Target/LoongArch LoongArchExpandPseudoInsts.cpp

LoongArch: Stop adding kill flags in LoongArchPreRAExpandPseudo

Continue purging kill flags on virtual registers.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+9-9llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp
+9-91 files

LLVM/project 4b00b3c — .github/workflows/require-team-membership action.yml

[GitHub] Use client-id in require-team-membership (#235060)

app-id is deprecated and presumably going away soon, and client-id is a
drop-in replacement for our needs.
DeltaFile
+1-1.github/workflows/require-team-membership/action.yml
+1-11 files

LLVM/project cce39e8 — flang/test/Evaluate fold-ibits.f90 fold-ibits-kind.f90, flang/test/Semantics kinds02.f90 kinds07.f90

test case cleanup
DeltaFile
+30-0flang/test/Evaluate/fold-ibits-kind.f90
+0-29flang/test/Evaluate/fold-ibits.f90
+13-0flang/test/Semantics/kinds07.f90
+0-11flang/test/Semantics/kinds02.f90
+43-404 files

LLVM/project ecb3678 — flang/include/flang/Evaluate fold.h, flang/lib/Evaluate fold-real.cpp intrinsics-library.cpp

Opportunistic filter of kind
DeltaFile
+47-39flang/lib/Evaluate/fold-implementation.h
+13-10flang/lib/Evaluate/fold-integer.cpp
+7-6flang/lib/Evaluate/fold-reduction.h
+12-1flang/include/flang/Evaluate/fold.h
+5-5flang/lib/Evaluate/fold-real.cpp
+6-4flang/lib/Evaluate/intrinsics-library.cpp
+90-6517 files not shown
+130-10023 files

LLVM/project a21a18e — flang/test/Semantics kinds01.f90 kinds02.f90

Extraced out in its own PR #235068
DeltaFile
+3-3flang/test/Semantics/kinds02.f90
+1-1flang/test/Semantics/kinds01.f90
+4-42 files

LLVM/project d04f8c2 — flang/lib/Lower/OpenMP OpenMP.cpp, flang/test/Lower/OpenMP/Todo interop-prefer-type-char-kind2.f90 interop-prefer-type-char-kind4.f90

Test case for GetScalarConstantValue<Ascii>
DeltaFile
+11-0flang/test/Lower/OpenMP/Todo/interop-prefer-type-char-kind2.f90
+11-0flang/test/Lower/OpenMP/Todo/interop-prefer-type-char-kind4.f90
+4-2flang/lib/Lower/OpenMP/OpenMP.cpp
+26-23 files

LLVM/project 18b3f3c — clang/test/CIR/Transforms canonicalize.cir

[CIR] Remove 'dead' test that no longer has a purpose. (#235069)

The patch #225814 stops us from rewriting unreachable blocks, and the
purpose of the original patch that wrote this test (#229191) intended to
make sure we handled unreachable blocks correctly.

So this test no longer matters. I left the original code in 229191 as it
is reasonable defensive code.
DeltaFile
+0-20clang/test/CIR/Transforms/canonicalize.cir
+0-201 files

LLVM/project c598e35 — flang/include/flang/Evaluate constant.h, flang/lib/Semantics expression.cpp

Allow conversion in ConstantBase ctors
DeltaFile
+14-3flang/test/Semantics/kinds02.f90
+2-2flang/include/flang/Evaluate/constant.h
+1-2flang/lib/Semantics/expression.cpp
+1-1flang/test/Semantics/kinds01.f90
+18-84 files

LLVM/project ffea91b — libc/cmake/modules LLVMLibCTestRules.cmake LLVMLibCCompileOptionRules.cmake

[libc] Suppress GCC's <mm_malloc.h> in freestanding builds (#234863)

Unlike Clang, GCC's <xmmintrin.h> (included via <immintrin.h>)
unconditionally includes <mm_malloc.h> even with -ffreestanding, which
in turn includes <stdlib.h>.

In full-build mode, targets that use x86 intrinsics (such as op_x86.h)
don't declare a dependency on libc.include.stdlib (and they don't really
need it). If these targets are built before our stdlib.h header is
generated, this will end up including the system stdlib.h -- and fail
miserably because of mixing of standard libraries. This can happen
already, but the problem gets more acute if we remove (#234150)
transitive full-header dependencies from the proxy headers (as it lets
us build these targets much sooner).

Since we don't use _mm_malloc or _mm_free, I'm suppressing <mm_malloc.h>
by defining its include guard (_MM_MALLOC_H_INCLUDED) on x86/x86_64 GCC
full builds.

Assisted-by: Gemini
DeltaFile
+7-0libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+4-0libc/cmake/modules/LLVMLibCTestRules.cmake
+11-02 files

LLVM/project cbea8f6 — flang/lib/Evaluate fold-implementation.h character-value.cpp, flang/test/Lower char-kind-convert-nonascii.f90

ToAscii may fail
DeltaFile
+36-0flang/test/Semantics/char-kind-convert-nonascii.f90
+18-9flang/unittests/Evaluate/CharacterValueTest.cpp
+23-0flang/test/Lower/char-kind-convert-nonascii.f90
+7-4flang/lib/Evaluate/character-value-impl.cpp
+5-2flang/lib/Evaluate/character-value.cpp
+1-3flang/lib/Evaluate/fold-implementation.h
+90-182 files not shown
+94-208 files

LLVM/project 6d90ce1 — llvm/include/llvm/IR RuntimeLibcalls.td, llvm/unittests/IR RuntimeLibcallsTest.cpp

RuntimeLibcalls: Split __atomic_* into a separate libatomic library

The __atomic_* functions are not part of libgcc or the default
compiler-rt builtins. GCC ships them in libatomic, and compiler-rt in the
optional clang_rt.atomic. Every system that uses compiler-rt also lists
libatomic, so the available functions are unchanged.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+51-20llvm/include/llvm/IR/RuntimeLibcalls.td
+11-9llvm/unittests/IR/RuntimeLibcallsTest.cpp
+62-292 files

LLVM/project 30a6832 — llvm/lib/Target/WebAssembly WebAssemblyExplicitLocals.cpp WebAssemblyMemIntrinsicResults.cpp, llvm/test/CodeGen/WebAssembly explicit-locals.mir

WebAssembly: Stop adding kill flags on virtual registers (#234968)

Continue purging new kill flags on virtual registers.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+3-10llvm/lib/Target/WebAssembly/WebAssemblyMemIntrinsicResults.cpp
+2-5llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
+2-3llvm/test/CodeGen/WebAssembly/explicit-locals.mir
+7-183 files

LLVM/project 6337091 — offload/libompaccsupport device.cpp, offload/test/offloading generic_spmd_grid.c

[OpenMP][offload] Trade threads for blocks in Generic-SPMD kernels

The threads of a Generic-SPMD block run the inner parallel loops, whose
trip counts are unknown. Halve the threads down to one warp while the
distribute loop has an iteration for every block, and default to 6
blocks per CU on AMDGPU (LIBOMPTARGET_AMDGPU_GENERIC_SPMD_TEAMS_PER_CU).
libomptarget reads the number of compute units and the platform backend
of the device through liboffload, as part of its geometry properties.

This is an upstream port of the corresponding downstream.

Claude assisted with this patch.
DeltaFile
+56-0offload/test/offloading/generic_spmd_grid.c
+41-5offload/libompaccsupport/device.cpp
+11-0openmp/docs/design/Runtimes.md
+108-53 files

LLVM/project c849351 — offload/libompaccsupport device.cpp, openmp/docs/design Runtimes.md

rename env var
DeltaFile
+8-8openmp/docs/design/Runtimes.md
+3-3offload/libompaccsupport/device.cpp
+11-112 files

LLVM/project 59a712e — offload/libompaccsupport device.cpp, offload/test/offloading teams_reduction_grid.c

[OpenMP][offload] Size the grid of cross-team reductions by their size

Every block adds to the cost of combining the partial results of a
cross-team reduction. Launch one block per compute unit for reductions
that work with a reduction data size of more than 32 bytes, and enough
blocks for a per-device number of waves per compute unit (16 on AMDGPU)
for the smaller reduction data sizes, capped by the trip count. Such
kernels keep their number of threads: the low-trip-count reduction of
threads does not apply to them. libomptarget reads the number of compute
units and the platform backend of the device through liboffload, as part
of its geometry properties.

This is an upstream port of the corresponding downstream.

Claude assisted with this patch.
DeltaFile
+68-0offload/test/offloading/teams_reduction_grid.c
+60-0offload/libompaccsupport/device.cpp
+15-0openmp/docs/design/Runtimes.md
+143-03 files

LLVM/project 8d2c5c9 — offload/libompaccsupport device.cpp, offload/test/offloading teams_reduction_grid.c

[OpenMP][offload] Size only reductions that fill the device by their size

A cross-team reduction whose loop is too short for one block per compute
unit now gets the grid of a kernel without a reduction. In SPMD mode,
that is the low-trip-count rule, which lowers the number of threads per
block to spread the iterations over more compute units. Keeping all
threads made such reductions, e.g. one of 1792 iterations, up to 2.5x
slower on MI210.

Claude assisted with this patch.
DeltaFile
+30-11offload/test/offloading/teams_reduction_grid.c
+10-6offload/libompaccsupport/device.cpp
+6-4openmp/docs/design/Runtimes.md
+46-213 files

LLVM/project 7c462fe — llvm/include/llvm/IR RuntimeLibcalls.td, llvm/test/TableGen RuntimeLibcallEmitter.td RuntimeLibcallEmitter-library-ref.td

RuntimeLibcalls: Specify system libraries by name (#233569)

Each system is now described by a list of default library names.
Per-target exclusions become standalone LibraryExclusion defs.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+140-119llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
+47-65llvm/include/llvm/IR/RuntimeLibcalls.td
+28-31llvm/test/TableGen/RuntimeLibcallEmitter-calling-conv.td
+53-0llvm/test/TableGen/RuntimeLibcallEmitter-library-exclusion.td
+0-51llvm/test/TableGen/RuntimeLibcallEmitter-library-ref.td
+22-27llvm/test/TableGen/RuntimeLibcallEmitter.td
+290-29318 files not shown
+512-38224 files

LLVM/project d269257 — offload/libompaccsupport device.cpp

fix query
DeltaFile
+2-2offload/libompaccsupport/device.cpp
+2-21 files

LLVM/project 404df84 — offload/include device.h, offload/libompaccsupport PluginManager.cpp device.cpp

make device initialization more liboffload friendly (#235001)
DeltaFile
+12-5offload/libompaccsupport/device.cpp
+2-8offload/libompaccsupport/PluginManager.cpp
+4-3offload/include/device.h
+18-163 files

LLVM/project 201cb03 — clang/lib/CIR/Dialect/Transforms/TargetLowering CIRABIRewriteContext.cpp, clang/test/CIR/CodeGen call-conv-lowering-x86_64-non-byval.cpp attr-noundef.cpp

[CIR] Set dead_on_return for non-byval indirect arguments (#234773)

This change updates the CIR calling convention rewrite context to set
the dead_on_return attribute when lowering non-byval indirect arguments
to match the behavior of classic codegen.

Assisted-by: Cursor / various models
DeltaFile
+37-37clang/test/CIR/Transforms/abi-lowering/indirect-non-byval-forward-param.cir
+18-26clang/test/CIR/CodeGen/call-conv-lowering-x86_64-vptr.cpp
+18-9clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp
+13-13clang/test/CIR/Transforms/abi-lowering/indirect-byval.cir
+6-8clang/test/CIR/CodeGen/attr-noundef.cpp
+2-3clang/test/CIR/CodeGen/call-conv-lowering-x86_64-non-byval.cpp
+94-963 files not shown
+98-1019 files