LLVM/project 139505c — llvm/lib/Analysis InstructionSimplify.cpp, llvm/lib/Transforms/InstCombine InstCombineCalls.cpp

Implement in Simplify
DeltaFile
+10-20llvm/test/Transforms/InstSimplify/fptoi-sat.ll
+1-16llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+17-0llvm/lib/Analysis/InstructionSimplify.cpp
+28-363 files

LLVM/project ee4029a — llvm/lib/CodeGen TwoAddressInstructionPass.cpp, llvm/test/CodeGen/AMDGPU twoaddr-insert-subreg-undef.mir

TwoAddressInstructions: Keep undef INSERT_SUBREG lanes defined (#230931)

%reg = INSERT_SUBREG undef %reg, %subreg, subidx defines all of %reg, so
reading the lanes outside subidx afterwards is valid. Rewriting it to
undef %reg.subidx = COPY %subreg narrows the definition to subidx and
leaves those reads without a live subrange, failing the "No live subrange at use"
machine verifier check.

When a subrange outside subidx is still live past the def, insert an
IMPLICIT_DEF of the full register and drop the undef flag. In the common
case, where the lanes the INSERT_SUBREG left undefined are dead, keep
the undef flag and avoid an IMPLICIT_DEF that survives to the end of codegen
when the COPY is not coalesced.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
DeltaFile
+55-0llvm/test/CodeGen/AMDGPU/twoaddr-insert-subreg-undef.mir
+28-7llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+83-72 files

LLVM/project 1491508 — mlir/include/mlir/Dialect/LLVMIR LLVMOpBase.td LLVMOps.td, mlir/lib/Dialect/LLVMIR/IR LLVMDialect.cpp

[mlir][LLVM] Add ignore_denormal_mode UnitAttr to LLVM::AtomicRMWOp (#217588)

Add an `ignore_denormal_mode` unit attribute to `llvm.atomicrmw`. It
maps 1:1 to the target-independent `!atomic.ignore.denormal.mode`
instruction metadata (#217585): export attaches the metadata when the
attribute is set, and import sets the attribute when the metadata is
present.

The metadata tells the backend that the atomic may ignore the function's
denormal mode, so a native atomic instruction with fixed denormal
behavior can be used instead of a CAS loop. AMDGPU already honors it,
and NVPTX does as of #217586. Until now MLIR could only produce it on
AMDGPU, through the discardable `rocdl.ignore_denormal_mode` attribute.
That leaves frontends like XLA with no way to request it for NVPTX, and
forces target-specific code for something that is target-independent in
LLVM IR.

The attribute is modeled like `volatile_`: an inherent unit attribute
with an optional `ignore_denormal_mode` keyword in the assembly format

    [12 lines not shown]
DeltaFile
+22-5mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+8-7mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+8-0mlir/test/Dialect/LLVMIR/invalid.mlir
+7-0mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
+4-0mlir/test/Target/LLVMIR/Import/instructions.ll
+4-0mlir/test/Dialect/LLVMIR/roundtrip.mlir
+53-121 files not shown
+55-127 files

LLVM/project 9612cc2 — llvm/lib/Target/AArch64 AArch64InstrFormats.td, llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp

fixup! Also rename the tablegen and case names, and re-order the DiagnosticType so it matches the operand name
DeltaFile
+74-74llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+37-36llvm/lib/Target/AArch64/AArch64InstrFormats.td
+111-1102 files

LLVM/project 5621ea5 — llvm/lib/CodeGen RegAllocGreedy.h RegAllocGreedy.cpp

RegAllocGreedy: Skip redundant hint recoloring walks

Each broken hint starts a walk over its copy-connected registers. When
many broken hints share one large component, as happens after PHI
elimination splits many critical edges into a block, the same component
is walked over and over, which is quadratic.

A walk that recolors nothing changes no assignments, so a later walk
from any register it reached would also recolor nothing. Skip those
seeds until the next recoloring.

On a stress test with 4000 split critical edges, Greedy drops from 40.8G
to 3.8G instructions.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+17-3llvm/lib/CodeGen/RegAllocGreedy.cpp
+1-1llvm/lib/CodeGen/RegAllocGreedy.h
+18-42 files

LLVM/project 8e02f08 — llvm/lib/Analysis InstructionSimplify.cpp, llvm/lib/Transforms/InstCombine InstCombineCalls.cpp

Implement in Simplify
DeltaFile
+10-20llvm/test/Transforms/InstSimplify/fptoi-sat.ll
+17-0llvm/lib/Analysis/InstructionSimplify.cpp
+0-14llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+27-343 files

LLVM/project bd737a9 — llvm/lib/Transforms/InstCombine InstCombineCalls.cpp

[InstCombine] Fold fpto[su]i.sat of NaN guarded select

fpto[su]i.sat returns 0 for both NaN and $\pm 0.0$, so a select that
replaces a NaN input with zero does not change the result, and the call
can take X directly.

```llvm
%not.nan = fcmp ord float %x, 0.0
%sel = select i1 %not.nan, float %x, float 0.0
%r = call i32 @llvm.fptosi.sat.i32.f32(float %sel)
  -->
%r = call i32 @llvm.fptosi.sat.i32.f32(float %x)
```

The inverted form `select (fcmp uno X, 0.0), 0.0, X` is folded too.
Only the canonical `fcmp ord/uno X, 0.0` is matched, which also covers
`oeq/une X, X` after fcmp canonicalization.
DeltaFile
+16-1llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+16-11 files

LLVM/project a35d563 — llvm/test/Transforms/InstSimplify fptoi-sat.ll

[InstCombine] Add tests for fpto[su]i.sat of NaN guarded select. NFC

fpto[su]i.sat returns 0 for NaN and +/-0.0, so the select is redundant.
Cover ord/oeq/uno/une checks, scalar and vector, and negative cases.
DeltaFile
+163-0llvm/test/Transforms/InstSimplify/fptoi-sat.ll
+163-01 files

LLVM/project 368f3f8 — llvm/lib/CodeGen/AsmPrinter DbgEntityHistoryCalculator.cpp

[DebugInfo] Skip debug history clobber scans without register locations (NFC) (#230590)

Improves compile-time across all debug configurations.

CTMark results [1]:

- stage1-O0-g -0.35%
- stage1-aarch64-O0-g -0.37%
- stage2-O0-g -0.36%

[1] https://llvm-compile-time-tracker.com/compare.php?from=fc90bd3cfb0bab14a2bf7cbd33f5f1e904c7e133&to=46ed6c07b21098bf8299e05bfeb4ccf433d5d807&stat=instructions:u

Assisted-by: codex
DeltaFile
+4-0llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
+4-01 files

LLVM/project 3261d9d — clang/lib/CIR/CodeGen CIRGenDecl.cpp CIRGenModule.h, clang/test/CIR/CodeGenHIP spirv-constant-addrspace.hip

[CIR][HIP][SPIR-V] Emit constant globals in addrspace(1) (#230813)

CIR treated HIP `__constant__` like OpenCL constant, which is
addrspace(2) on SPIR-V

Align behavior with classic codegen
DeltaFile
+38-0clang/test/CIR/CodeGenHIP/spirv-constant-addrspace.hip
+17-5clang/lib/CIR/CodeGen/CIRGenModule.cpp
+2-2clang/lib/CIR/CodeGen/CIRGenDecl.cpp
+4-0clang/lib/CIR/CodeGen/CIRGenModule.h
+61-74 files

LLVM/project a84637d — llvm/lib/Target/SystemZ SystemZISelLowering.cpp SystemZISelLowering.h

SystemZ: Move getPreferredVectorAction out of line (NFC) (#231093)

Shrink the diff in a future change.
DeltaFile
+2-23llvm/lib/Target/SystemZ/SystemZISelLowering.h
+24-0llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+26-232 files

LLVM/project ec14118 — llvm/lib/Target/Mips MipsSetMachineRegisterFlags.cpp MipsSEInstrInfo.cpp, llvm/test/CodeGen/Mips fpbr.ll r6-fp-condition-subregs.ll

[Mips] Fix R6 floating-point condition register handling (#226838)

Sharing a predicate between R6 floating-point selects can produce copies
between incompatible register classes and crash in copyPhysReg. The
condition classes model both CMP.S and CMP.D results as i32, despite the
instructions writing 32-bit and 64-bit FPRs respectively.

Use ordinary FPR classes for compare results and tied select operands.
Represent the legalized i32 condition with a same-width copy for CMP.S
and a low-word subregister for CMP.D. Insert the condition into the low
word for SEL.D, leaving the unused upper word undefined. This lets
register coalescing handle shared predicates and mixed-precision users,
removing the special condition classes, copy heuristics and
register-flags pass.

Select BC1EQZ/BC1NEZ directly for FP comparison conditions, including
their microMIPS counterparts, and support them in branch analysis. These
branches read bit zero, avoiding a GPR transfer and boolean
normalization. Fold normalization of known 0/-1 masks into zero/nonzero

    [14 lines not shown]
DeltaFile
+434-0llvm/test/CodeGen/Mips/r6-fp-branch.ll
+217-0llvm/test/CodeGen/Mips/r6-fp-condition-subregs.ll
+103-62llvm/lib/Target/Mips/Mips32r6InstrInfo.td
+24-116llvm/lib/Target/Mips/MipsSEInstrInfo.cpp
+0-111llvm/lib/Target/Mips/MipsSetMachineRegisterFlags.cpp
+47-40llvm/test/CodeGen/Mips/fpbr.ll
+825-32920 files not shown
+975-49626 files

LLVM/project ee5fc90 — clang/lib/AST/ByteCode EvaluationResult.cpp, clang/test/AST/ByteCode invalid.cpp

[clang][bytecode] Check for invalid record decls when returning a pointer from an evaluation (#230907)

We do allow creating such records for diagnostic purposes, but we
shouldn't allow returning them from an evaluation.
DeltaFile
+11-0clang/test/AST/ByteCode/invalid.cpp
+5-0clang/lib/AST/ByteCode/EvaluationResult.cpp
+16-02 files

LLVM/project 054e658 — llvm/include/llvm/TableGen Record.h, llvm/lib/TableGen Record.cpp

TableGen: Cache resolved class instantiations

The same class instantiation is often referenced many times in one
record, and each reference was resolved from scratch along with
everything nested in its arguments. Cache the results in MapResolver and
RecordResolver, and share them with any TrackUnresolvedResolver wrapping
those.

Gigainstructions executed by llvm-tblgen --null-backend

             before   after
  AMDGPU.td   71.75   18.22  -74.6%
  X86.td       6.10    6.15   +0.8%
  AArch64.td   3.28    3.32   +1.3%
  RISCV.td     8.18    8.26   +1.0%

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+138-3llvm/include/llvm/TableGen/Record.h
+14-4llvm/lib/TableGen/Record.cpp
+152-72 files

LLVM/project c4488bc — llvm/include/llvm/TableGen Record.h, llvm/lib/TableGen Record.cpp

TableGen: Skip resolving values that cannot change (#231083)

Lists, dags, bits and arguments made only of leaf values always resolve
to themselves, but resolving them still walked every element. Record
this when they are created and return early.

Gigainstructions executed by llvm-tblgen --null-backend

|             |before |after |      |
|-------------|-------|------|------|
|  AMDGPU.td  |79.12  |71.73 | -9.3%|
|  X86.td     | 6.25  | 6.12 | -2.1%|
|  AArch64.td | 3.40  | 3.28 | -3.7%|
|  RISCV.td   | 8.34  | 8.19 | -1.8%|

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+18-2llvm/include/llvm/TableGen/Record.h
+19-0llvm/lib/TableGen/Record.cpp
+37-22 files

LLVM/project dc6d254 — llvm/include/llvm/IR RuntimeLibcalls.td

RuntimeLibcalls: Fix wrong types of some vector math functions

The f32 x86 libmvec __expf_finite, __logf_finite and __powf_finite
variants were assigned to the f64 libcalls, and amd_vrd4_erf and
amd_vrd8_erf to the f32 ones.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+10-13llvm/include/llvm/IR/RuntimeLibcalls.td
+10-131 files

LLVM/project b3256ae — llvm/docs LangRef.md, llvm/include/llvm/Analysis Loads.h

[VectorCombine] Ignore frees when checking dereferenceability for load widening (#218657)

For load widening, we can ignore frees in dereferenceability checks: The
presence of the load proves that the object cannot have been freed.

The only concern here is in-place shrinkage of allocations. In that
case, it could be that the object is no longer dereferenceable for the
wide load type, but still dereferenceable for the narrow load type.

LangRef currently does not allow shrinking allocations. We discussed
whether we plan to allow this in the future in a recent formal spec WG
meeting, and I believe there was a quite strong consensus that we do not
want to allow shrinking allocations in the future. I believe that
follow-up discussions on the Rust side also failed to produce any
compelling use-cases.

So this PR makes use of the fact that allocations can't shrink in
VectorCombine.
DeltaFile
+58-0llvm/test/Transforms/VectorCombine/X86/load-inseltpoison.ll
+10-3llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+7-5llvm/lib/Analysis/Loads.cpp
+4-2llvm/include/llvm/Analysis/Loads.h
+2-2llvm/docs/LangRef.md
+81-125 files

LLVM/project c3af28d — llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp, llvm/test/CodeGen/AVR expand-wide-mul.ll

[SDAG] Don't expand forceExpandWideMUL to libcall with unsuitable types. (#230522)

When the wide type is legal or the narrow type isn't, emit a wide MUL
and let it legalise normally to avoid setting up the call incorrectly.

This came up while doing more testing with [su]mulh intrinsics. It seems
it could also be triggered with umulfix, for instance.
DeltaFile
+63-0llvm/test/CodeGen/AVR/expand-wide-mul.ll
+15-0llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+78-02 files

LLVM/project 7159ce5 — llvm/include/llvm/IR IntrinsicInst.h, llvm/lib/IR IntrinsicInst.cpp

[IR] Remove unused debug intrinsic methods (NFC) (#231075)

DbgVariableIntrinsic::replaceVariableLocationOp(unsigned, Value *),
DbgVariableIntrinsic::setKillLocation, and
DbgVariableIntrinsic::setRawLocation: The last callers were removed on
July 18, 2025 in commit c9d8b68676dbf51996a76475313088f750697343.

DbgVariableIntrinsic::addVariableLocationOps,
DbgAssignIntrinsic::setAddressExpression, and
DbgAssignIntrinsic::setKillAddress: The last callers were removed on
July 18, 2025 in commit 2a1869b9815c1f59af9eae91a3ef7e7d78e8f4f2,
leaving DbgAssignIntrinsic::isKillAddress unused as well.

DbgVariableIntrinsic::setVariable and DbgLabelInst::setLabel: The last
callers were removed on June 17, 2025 in commit
9eb0020555fc643582b2802abb8c1bc92059c248.

DbgVariableIntrinsic::isAddressOfVariable: The last caller was removed
on July 21, 2025 in commit c9ceb9b75fd547c7d2e79837075370f4c8db8faa.

Assisted-by: Antigravity
DeltaFile
+0-50llvm/include/llvm/IR/IntrinsicInst.h
+0-46llvm/lib/IR/IntrinsicInst.cpp
+0-962 files

LLVM/project 444bd7d — clang/lib/AST Decl.cpp

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

PointerUnion::dyn_cast has been soft-deprecated in favor of
llvm::dyn_cast and llvm::dyn_cast_if_present.  This patch replaces the
former with llvm::dyn_cast where the operand is guaranteed to be
nonnull.

Note that VDTemplSpec->getInstantiatedFrom() here returns
getSpecializedTemplateOrPartial() because the enclosing if statement
checks isTemplateInstantiation(...).  In turn,
getSpecializedTemplateOrPartial() always returns a nonnull pointer by
construction.

Assisted-by: Antigravity
DeltaFile
+2-2clang/lib/AST/Decl.cpp
+2-21 files

LLVM/project 326ddc1 — llvm/lib/Target/SystemZ SystemZISelLowering.cpp SystemZISelLowering.h

SystemZ: Move getPreferredVectorAction out of line (NFC)

Shrink the diff in a future change.
DeltaFile
+2-23llvm/lib/Target/SystemZ/SystemZISelLowering.h
+24-0llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+26-232 files

LLVM/project efef068 — clang/include/clang/CIR MissingFeatures.h, clang/lib/CIR/CodeGen CIRGenBuiltinAMDGPU.cpp

[CIR][AMDGPU] Add support for AMDGCN grid_size builtins (#230798)

Port EmitAMDGPUGridSize from classic codegen
DeltaFile
+54-0clang/test/CIR/CodeGenHIP/amdgcnspirv-builtins.hip
+31-9clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp
+20-0clang/test/CIR/CodeGenHIP/builtins-amdgcn.hip
+1-0clang/include/clang/CIR/MissingFeatures.h
+106-94 files

LLVM/project a956c8e — llvm/include/llvm/CodeGen TargetLowering.h, llvm/lib/CodeGen/GlobalISel LegalizerHelper.cpp

[CodeGen] Return an IR type from getCmpLibcallReturnType (NFC) (#227192)

Refactor `getCmpLibcallReturnType()` to return an IR `IntegerType`, as
suggested by @arsenm in #226813.

This hook is only overriden by AVR and MSP430, so only those two targets
are changed.
DeltaFile
+5-5llvm/include/llvm/CodeGen/TargetLowering.h
+2-2llvm/lib/Target/MSP430/MSP430ISelLowering.h
+2-2llvm/lib/Target/AVR/AVRISelLowering.h
+1-1llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+1-1llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+11-115 files

LLVM/project 6e36a6a — llvm/include/llvm/TableGen Record.h, llvm/lib/TableGen Record.cpp

TableGen: Cache resolved class instantiations

The same class instantiation is often referenced many times in one
record, and each reference was resolved from scratch along with
everything nested in its arguments. Cache the results in MapResolver and
RecordResolver, and share them with any TrackUnresolvedResolver wrapping
those.

Gigainstructions executed by llvm-tblgen --null-backend

             before   after
  AMDGPU.td   71.75   18.22  -74.6%
  X86.td       6.10    6.15   +0.8%
  AArch64.td   3.28    3.32   +1.3%
  RISCV.td     8.18    8.26   +1.0%

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+138-3llvm/include/llvm/TableGen/Record.h
+14-4llvm/lib/TableGen/Record.cpp
+152-72 files

LLVM/project 9b4ca09 — llvm/include/llvm/TableGen Record.h, llvm/lib/TableGen Record.cpp

TableGen: Skip resolving values that cannot change

Lists, dags, bits and arguments made only of leaf values always resolve
to themselves, but resolving them still walked every element. Record
this when they are created and return early.

Gigainstructions executed by llvm-tblgen --null-backend

             before   after
  AMDGPU.td   79.12   71.73   -9.3%
  X86.td       6.25    6.12   -2.1%
  AArch64.td   3.40    3.28   -3.7%
  RISCV.td     8.34    8.19   -1.8%

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+18-2llvm/include/llvm/TableGen/Record.h
+19-0llvm/lib/TableGen/Record.cpp
+37-22 files

LLVM/project 489d100 — llvm/lib/TableGen Record.cpp

TableGen: Use DenseMap for the IntInit pool (#231082)

Gigainstructions executed by llvm-tblgen --null-backend

             before   after
  AMDGPU.td   79.34   79.13   -0.3%
  X86.td       6.30    6.25   -0.7%
  AArch64.td   3.43    3.41   -0.6%
  RISCV.td     8.40    8.34   -0.7%

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+1-2llvm/lib/TableGen/Record.cpp
+1-21 files

LLVM/project 00697da — llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/lib/Target/X86 X86ISelLowering.cpp

[DAGCombiner] Narrow the integer source of sint_to_fp (#224242)

Truncate the source of a `sint_to_fp` when it is known to fit in a
narrower
type the target can convert from directly.
For example:
```
    sitofp (sext i32 %x to i64) to float
```
On AMDGPU this becomes a single `v_cvt_f32_i32` instead of the generic
i64 to f32 expansion.

Note: X86 marks i16 sint_to_fp as Custom, but SSE only supports
conversion from
i32, so the custom lowering sign-extends i16 back to i32. Mark i16 as
undesirable to avoid a redundant movswl.
DeltaFile
+169-769llvm/test/CodeGen/AMDGPU/int_to_fp_narrow_i64.ll
+29-0llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+1-0llvm/lib/Target/X86/X86ISelLowering.cpp
+199-7693 files

LLVM/project c288f9f — clang/test/CodeGen/AArch64/sve minv.c, clang/test/CodeGen/AArch64/sve-intrinsics acle_sve_minv.c

[clang][CIR] Add tests for SVE MINV intrinsics (#230081)

adds CIR tests for svminv (plain SVE) intrinsics.

Moves and adapts sve-intrinsics/acle_sve_minv.c to sve/minv.c.

Part of #223963
DeltaFile
+0-207clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_minv.c
+207-0clang/test/CodeGen/AArch64/sve/minv.c
+207-2072 files

LLVM/project 0e2216d — llvm/lib/Target/AArch64 AArch64TargetTransformInfo.h, llvm/test/Transforms/ScalarizeMaskedMemIntrin/AArch64 expand-masked-load.ll expand-masked-store.ll

[AArch64] Mark masked load/store data types that get legalized to scalars illegal (#228122)

Masked load/stores cannot handle data types that get scalarized during
type legalization. This PR marks them illegal in AArch64 TTI so they get
expanded before reaching SDAG.

Fixes e.g. the crash:

```llvm
; llc -mtriple=aarch64 -mattr=+sve crash.ll

define <1 x half> @masked_load_v1f16(ptr %p, <1 x i1> %mask) vscale_range(2,2) {
  %load = call <1 x half> @llvm.masked.load.v1f16.p0(ptr %p, <1 x i1> %mask, <1 x half> poison)
  ret <1 x half> %load
}
```
DeltaFile
+114-0llvm/test/Transforms/ScalarizeMaskedMemIntrin/AArch64/expand-masked-store.ll
+87-0llvm/test/Transforms/ScalarizeMaskedMemIntrin/AArch64/expand-masked-load.ll
+6-0llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h
+207-03 files

LLVM/project 0f410d4 — llvm/lib/Target/AMDGPU AMDGPUEventTracking.cpp AMDGPUEventTracking.h

Claude Opus 5.5-powered doc cleanups (with human touch)
DeltaFile
+86-70llvm/lib/Target/AMDGPU/AMDGPUEventTracking.h
+34-36llvm/lib/Target/AMDGPU/AMDGPUEventTracking.cpp
+120-1062 files