LLVM/project 142de6e — clang/lib/CodeGen CGStmt.cpp, clang/test/CodeGen/X86 inline-asm-complex-output.c

[Clang][CodeGen] Pass 128-bit aggregate inline asm register inputs by value

Clang returns a register output of aggregate type, such as '_Complex
double' or a 16-byte struct, by value as an integer of the same size
(i128 for both). EmitAsmInputLValue, however, loaded aggregate register
inputs by value only up to 64 bits and passed larger ones by pointer.
So '"+r"' on a '_Complex double' emitted '"=r,*0"', which SelectionDAG
rejects as an unsupported tied indirect register input, and '"r"' on a
16-byte struct emitted '"*r"', which it rejects as an indirect register
input. Read-write '"rm"' and '"g"' operands hit the same error.

Load power-of-2 aggregate register inputs of up to 128 bits by value,
as with '__int128'. Tied aggregate operands of other sizes are still
passed by pointer and rejected.

Assisted-by: Claude Opus 5.5
DeltaFile
+75-8clang/test/CodeGen/X86/inline-asm-complex-output.c
+1-1clang/lib/CodeGen/CGStmt.cpp
+76-92 files

LLVM/project 14a3c75 — llvm/lib/CodeGen/GlobalISel InlineAsmLowering.cpp, llvm/test/CodeGen/AArch64/GlobalISel arm64-fallback.ll

[GlobalISel] Fall back on tied inline asm inputs needing several registers

InlineAsmLowering ties a matching input to a single register, and
asserted that the output it matches uses only one. But an i128 output
with an "r" constraint on AArch64 uses two 64-bit registers, so '"+r"'
on an '__int128' crashed at -O0, where GlobalISel is the default. Fall
back to SelectionDAG, which ties each register, instead.

Assisted-by: Claude Opus 5.5
DeltaFile
+9-1llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
+10-0llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
+19-12 files

LLVM/project aa2abf0 — lld/MachO SyntheticSections.cpp, lld/MachO/Arch ARM64.cpp

[lld][MachO] Support Objective-C class selector stubs

Support Objective-C class selector stubs in lld's Mach-O backend.

This consumes the class-stub symbols emitted by Clang in [ObjC] Emit class
msgSend stub calls (#186433), using the form
`_objc_msgSendClass$<selector>$_OBJC_CLASS_$_<class>`.

Class stubs load the class object into `x0`, load the selector into `x1`, and
branch to `_objc_msgSend`. Local class symbols are materialized directly with
`adrp`/`add`; dylib or dynamic class symbols are loaded indirectly.

The implementation also tracks the resolved class symbol before dead stripping
so live class stubs can retain the needed class definition without keeping dead
dylib references alive.

Preserve the effective weakness of imported classes when adding synthesized
GOT references. Ordinary weak class references remain optional; genuine
strong references and bare stubs without weak metadata remain strong. Cover

    [2 lines not shown]
DeltaFile
+369-0lld/test/MachO/arm64-objc-class-stubs.s
+172-0lld/test/MachO/arm64-objc-class-stubs-weak.s
+112-14lld/MachO/SyntheticSections.cpp
+85-0lld/MachO/Arch/ARM64.cpp
+82-0lld/test/MachO/arm64-objc-class-stubs-dead.s
+46-0lld/test/MachO/objc-class-stubs-unsupported.s
+866-145 files not shown
+936-2111 files

LLVM/project 169dccf — lld/MachO Driver.cpp, lld/test/MachO arm64-objc-stubs-autolink.s

[lld][MachO] Fix ObjC stubs from autolinked archives (#219743)

Move ObjC stub preparation after LC_LINKER_OPTION processing so archive
members loaded through autolink can contribute `_objc_msgSend$` selector
stubs before selector references are finalized.

Otherwise, stubs discovered from autolinked archives may not get
matching `__objc_methname` and `__objc_selrefs` entries needed during
stub emission.
DeltaFile
+35-0lld/test/MachO/arm64-objc-stubs-autolink.s
+2-1lld/MachO/Driver.cpp
+37-12 files

LLVM/project b4a39a7 — lld/MachO SyntheticSections.h SyntheticSections.cpp

[lld][MachO][NFC] Prepare ObjC stubs for variable sizes (#219742)

This is a NFC to prepare for the next PRs:
- Track the total `__objc_stubs` size explicitly as entries are added,
so stub offsets no longer assume every stub has the same size.
 - Rename `symbolPrefix` to `objcMsgSendStubPrefix` for clarity.
DeltaFile
+11-10lld/MachO/SyntheticSections.cpp
+3-1lld/MachO/SyntheticSections.h
+14-112 files

LLVM/project 9db9c00 — llvm/lib/CodeGen/SelectionDAG SelectionDAGBuilder.cpp, llvm/test/CodeGen/AArch64 inline-asm-prepare.ll

Merge branch 'users/void/callbr-asm-error' into users/void/asm-goto-_Complext-types
DeltaFile
+143-180llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+115-0llvm/test/CodeGen/X86/callbr-asm-outputs-indirect-isel.ll
+87-0llvm/test/CodeGen/RISCV/callbr-asm-outputs.ll
+83-0llvm/test/CodeGen/X86/machine-cse-inlineasm-br.mir
+69-0llvm/test/CodeGen/X86/callbr-asm-error.ll
+65-0llvm/test/CodeGen/AArch64/inline-asm-prepare.ll
+562-1806 files not shown
+740-18612 files

LLVM/project 700eccf — clang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/lib/CIR/Dialect/Transforms CallConvLoweringPass.cpp

[CIR] Emit noundef attribute during calling convention lowering (#235140)

Classic CodeGen marks an argument noundef when its ABI classification is
Extend or Indirect unless -no-enable-noundef-analysis is used. CIR
codegen defers the ABI classification, so CallConvLowering now applies
this rule when it rewrites a signature or call site.

This also corrects an issue with missing signext/zeroext flags for
transparent unions that require extension.

Assisted-by: Cursor / various models
DeltaFile
+97-0clang/test/CIR/CodeGen/call-conv-lowering-x86_64-transparent-union.c
+88-0clang/test/CIR/CodeGen/call-conv-lowering-x86_64-no-noundef.cpp
+53-26clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp
+39-15clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+24-13clang/test/CIR/CodeGen/lowering-lang-options.cpp
+26-5clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
+327-5926 files not shown
+426-14532 files

LLVM/project 2f587d2 — llvm/test/CodeGen/AMDGPU neighboring-mfma-padding.mir, llvm/test/CodeGen/X86 expand-false-deps.mir compress-false-deps.mir

CodeGen: Remove -verify-machineinstrs from single -run-pass MIR tests

Since #228248 / 66366908, llc verifies MIR output by default. MIR
inputs were always verified so for an llc invocation running exactly
one pass with -run-pass, the -verify-machineinstrs flag does nothing
so these flags are pointless. We should more aggressively trim
-verify-machineinstrs uses in the future, but this covers the cases
that don't change behavior. This removal was performed by generated
script.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+17-17llvm/test/CodeGen/X86/bls-false-deps.mir
+16-16llvm/test/CodeGen/X86/bitcnt-false-deps.mir
+13-13llvm/test/CodeGen/X86/expand-false-deps.mir
+13-13llvm/test/CodeGen/X86/compress-false-deps.mir
+11-11llvm/test/CodeGen/AMDGPU/neighboring-mfma-padding.mir
+8-8llvm/test/MachineVerifier/AMDGPU/writelane_m0.mir
+78-782,161 files not shown
+3,261-3,2622,167 files

LLVM/project e541694 — llvm/lib/Target/AMDGPU SIShrinkInstructions.cpp, llvm/test/CodeGen/AMDGPU shrink-instructions-fold-imm-subreg.mir

AMDGPU: Fix folding 64-bit move imm into subreg use in SIShrinkInstructions (#237040)

foldImmediates folded the full 64-bit immediate of a move into a
subregister use, rather than the value of the used half. Extract the
immediate value of the used subregister. Global addresses were similarly
broken.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+171-0llvm/test/CodeGen/AMDGPU/shrink-instructions-fold-imm-subreg.mir
+13-6llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
+184-62 files

LLVM/project c9b6490 — clang/docs SafeBuffers.md BoundsSafety.md, clang/docs/BoundsSafety BoundsSafetyImplPlans.md BoundsSafetyUpstreamStatus.md

[BoundsSafety][Docs] Add an index page and upstream status for -fbounds-safety

Add BoundsSafety/index.md as the landing page for the -fbounds-safety
docs. It covers how to contribute, standardization efforts in WG14,
open-source adoption efforts, RFCs, and talks.

Add BoundsSafetyUpstreamStatus.md, which lists what is available
upstream, what is in progress, and what is planned, with links to the
relevant PRs and issues.

Leave a stub at the old BoundsSafety.html location so existing links keep
working.

Assisted-by: Opus 5.5
DeltaFile
+97-0clang/docs/BoundsSafety/index.md
+47-0clang/docs/BoundsSafety/BoundsSafetyUpstreamStatus.md
+2-6clang/docs/index.md
+7-0clang/docs/BoundsSafety.md
+1-2clang/docs/BoundsSafety/BoundsSafetyImplPlans.md
+1-1clang/docs/SafeBuffers.md
+155-91 files not shown
+156-107 files

LLVM/project f6e0191 — llvm/lib/MC MCAsmStreamer.cpp, llvm/test/MC/Mips relocation-n64.s micromips-expansions.s

[ARM][MIPS] Show reloc comments in compressed instruction byte-order (#233599)

Little endian instruction encoding for Thumb/microMIPS consists of
higher order half-word followed by lower order half-word, each in
little-endian order. Relocation bits in this encoding need special
mapping logic.

Example encoding (starting MSB): AA BB CC DD
Layout in memory (starting low byte) [BB AA] [DD CC]

Also fix test cases for Thumb/microMIPS that captured the previously
broken relocation comments.

Co-authored-by: Faraz Shahbazker <faraz.shahbazker at mediatek.com>
DeltaFile
+17-22llvm/test/MC/Mips/relocation.s
+14-14llvm/test/MC/Mips/micromips-relocations.s
+9-9llvm/test/MC/Mips/micromips-branch-fixup.s
+11-3llvm/lib/MC/MCAsmStreamer.cpp
+4-4llvm/test/MC/Mips/relocation-n64.s
+4-4llvm/test/MC/Mips/micromips-expansions.s
+59-5610 files not shown
+91-6416 files

LLVM/project 8801f95 — llvm/lib/Target/AMDGPU SIInstructions.td, llvm/test/CodeGen/AMDGPU packed-fp64.ll

[AMDGPU] Preserve non-canonical values in packed f64 fneg (#236405)

Select divergent v2f64 fneg with sign-bit XORs. Restrict the
V_PK_ADD_F64 pattern to canonicalize-of-fneg so bare negation preserves
signaling NaNs and all operand bits except the sign.

Add explicit fneg and canonicalize-of-fneg coverage, and update the
affected packed vector negation checks.

Fixes #236341

---------

Co-authored-by: Jay Foad <jay.foad at gmail.com>
DeltaFile
+124-64llvm/test/CodeGen/AMDGPU/packed-fp64.ll
+7-2llvm/lib/Target/AMDGPU/SIInstructions.td
+131-662 files

LLVM/project ec9976b — llvm/lib/Target/AMDGPU AMDGPUInstructionSelector.h AMDGPUISelDAGToDAG.cpp, llvm/test/CodeGen/AMDGPU scale-offset-flat.ll scale-offset-global.ll

[AMDGPU] Fix scale_offset with wrapping offsets (#238016)

On gfx1250, vector memory scales the sign-extended offset in 64 bits,
but SMEM scales the offset in 32 bits and then zero-extends it. Both
selectors set scale_offset either way, so global and flat accesses
miscompiled a 32-bit scaled index that wraps, and SMEM loads an index
whose 64-bit scaled value reaches 4 GiB.

Keep scale_offset only when nsw or known bits prove that the hardware
computes the same address. Fix the SMEM tests that expected the wrong
code.

Fixes #237993
DeltaFile
+365-82llvm/test/CodeGen/AMDGPU/scale-offset-smem.ll
+285-4llvm/test/CodeGen/AMDGPU/scale-offset-global.ll
+29-7llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+26-5llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+19-0llvm/test/CodeGen/AMDGPU/scale-offset-flat.ll
+2-2llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h
+726-1001 files not shown
+728-1017 files

LLVM/project 7067e38 — llvm/test/CodeGen/X86 vector-interleaved-load-i32-stride-8.ll vector-interleaved-load-i16-stride-7.ll

[X86] Enable SlotIndexes compaction by default

Compacting SlotIndexes before greedy allocation drops the entries of
erased instructions, so live range sizes and instruction distances
reflect the code being allocated rather than how much was erased
before it. AMDGPU has done this since #235806; do the same for X86.

Codegen changes only through allocation: no new crashes, verifier
errors or allocation failures in the lit suites, including
EXPENSIVE_CHECKS, and a stage-2 build of LLVM, clang and lld with
-verify-machineinstrs passes its own tests. On llvm-test-suite at -O3,
spills drop 0.3% and .text 0.06%, with compile time unchanged.

Most test updates are regenerated checks. misched-matmul now inserts
20 spills instead of 24. live-debug-vars-stale-slotindexes.mir gets
one more use of %27 so that accumulate_fit still reaches the stale
index path it was written for.
DeltaFile
+15,403-15,465llvm/test/CodeGen/X86/vector-interleaved-load-i64-stride-7.ll
+13,329-13,243llvm/test/CodeGen/X86/vector-interleaved-store-i64-stride-7.ll
+13,199-13,231llvm/test/CodeGen/X86/vector-interleaved-store-i64-stride-8.ll
+12,788-12,826llvm/test/CodeGen/X86/vector-interleaved-load-i64-stride-8.ll
+11,796-11,778llvm/test/CodeGen/X86/vector-interleaved-load-i16-stride-7.ll
+11,057-11,064llvm/test/CodeGen/X86/vector-interleaved-load-i32-stride-8.ll
+77,572-77,607447 files not shown
+344,071-345,717453 files

LLVM/project 490e671 — llvm/lib/Transforms/Coroutines CoroSplit.cpp, llvm/test/Transforms/Coroutines coro-split-final-suspend-profile.ll

Revert "[CoroSplit] Use resume-switch weights on the final-suspend de… (#238125)

…stroy branch (#237526)"

This reverts commit c797aca0865eae6328ddd4f327d905d4115f719f.

If we have some code like this that calls f (from the introduced test
case):
```cpp
for (int i = 0; i < 100; ++i) {
  Task t = f();
  while (!t.crt_handle.done())
    t.crt_handle.resume();
}
```

We call f.destroy 100 times, and hdl is null 100% of the time, which
contradicts the branch weights synthesized by the patch (~19/81).
DeltaFile
+0-67llvm/test/Transforms/Coroutines/coro-split-final-suspend-profile.ll
+3-19llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+3-862 files

LLVM/project b3ce411 — clang/lib/Sema SemaHLSL.cpp, clang/test/CodeGenHLSL/builtins WaveMultiPrefixCountBits.hlsl

first attempt

Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>
Copilot-Session: 40997c2f-5aaa-41c6-8d1f-3e2e9ada315f
DeltaFile
+63-0clang/test/SemaHLSL/BuiltIns/WaveMultiPrefixCountBits-errors.hlsl
+45-0clang/test/CodeGenHLSL/builtins/WaveMultiPrefixCountBits.hlsl
+32-10clang/lib/Sema/SemaHLSL.cpp
+20-0llvm/test/CodeGen/DirectX/WaveMultiPrefixCountBits.ll
+9-0llvm/lib/Target/DirectX/DXIL.td
+9-0llvm/test/CodeGen/DirectX/WaveMultiPrefixCountBits_errors.ll
+178-106 files not shown
+211-1012 files

LLVM/project 956dbd1 — llvm/lib/Target/AMDGPU AMDGPUInstructionSelector.cpp AMDGPUISelDAGToDAG.cpp

[AMDGPU] Return early in scale_offset wrap checks

Each wrap check now returns false itself, so the matchers no longer
need to guard the final Offset update with ScaleOffset. The update has
to stay after the checks, because the callers use Offset even when
the matcher fails. No functional change.
DeltaFile
+10-12llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+10-11llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+20-232 files

LLVM/project 0105110 — clang/docs BoundsSafetyAdoptionGuide.md BoundsSafetyImplPlans.md, clang/docs/BoundsSafety BoundsSafetyAdoptionGuide.md BoundsSafetyImplPlans.md

[BoundsSafety][Docs][NFC] Move -fbounds-safety docs into BoundsSafety/

Move BoundsSafety.md, BoundsSafetyAdoptionGuide.md and
BoundsSafetyImplPlans.md into a BoundsSafety/ directory without changing
their content, and update the references to them. A follow-up adds an
index page for the directory.

Assisted-by: Opus 5.5
DeltaFile
+0-969clang/docs/BoundsSafety.md
+969-0clang/docs/BoundsSafety/BoundsSafety.md
+0-238clang/docs/BoundsSafetyImplPlans.md
+238-0clang/docs/BoundsSafety/BoundsSafetyImplPlans.md
+0-79clang/docs/BoundsSafetyAdoptionGuide.md
+79-0clang/docs/BoundsSafety/BoundsSafetyAdoptionGuide.md
+1,286-1,2862 files not shown
+1,293-1,2938 files

LLVM/project 2655905 — llvm/include/llvm/CodeGen SelectionDAG.h, llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp SelectionDAG.cpp

[SelectionDAG] Expose the concat fold for DAG combining

Make FoldConcatVectors a SelectionDAG method shared by node construction
and DAG combining. Invoke it directly when revisiting concat operands
instead of using getNode to rerun construction-time folds.
DeltaFile
+17-20llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+5-0llvm/include/llvm/CodeGen/SelectionDAG.h
+2-2llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+24-223 files

LLVM/project 51826b1 — llvm/lib/Target/AMDGPU SIShrinkInstructions.cpp, llvm/test/CodeGen/AMDGPU shrink-instructions-fold-imm-subreg.mir

AMDGPU: Fix folding 64-bit move imm into subreg use in SIShrinkInstructions

foldImmediates folded the full 64-bit immediate of a move into a
subregister use, rather than the value of the used half. Extract the
immediate value of the used subregister. Global addresses were similarly
broken.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+171-0llvm/test/CodeGen/AMDGPU/shrink-instructions-fold-imm-subreg.mir
+13-6llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
+184-62 files

LLVM/project d26ed4a — llvm/lib/Target/AMDGPU SIInstrInfo.h SIShrinkInstructions.cpp, llvm/test/CodeGen/AMDGPU shrink-instructions-fold-imm-subreg.mir

AMDGPU: Fold global address into subregister use with lo/hi relocation

Split 64-bit relocations into the 32-bit halves when applying a
subregister extract, similar to how immediates are modified when
folding. The same split is applied when 64-bit mov pseudos are
expanded.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+64-42llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+14-9llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
+5-8llvm/test/CodeGen/AMDGPU/shrink-instructions-fold-imm-subreg.mir
+9-0llvm/lib/Target/AMDGPU/SIInstrInfo.h
+92-594 files

LLVM/project 7120cc7 — llvm/test/CodeGen/SystemZ twoaddr-kill.mir regcoal-subranges-update.mir

SystemZ: Remove kill flags on virtual registers from MIR tests (#236919)

The verifier will soon disallow these, so prepare test inputs. Delete
tests that were identical except for the kill flags.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+0-77llvm/test/CodeGen/SystemZ/machinelicm-sunk-kill-flags.mir
+30-30llvm/test/CodeGen/SystemZ/subregliveness-06.mir
+20-20llvm/test/CodeGen/SystemZ/regcoal-undef-lane-4-rm-cp-commuting-def.mir
+13-13llvm/test/CodeGen/SystemZ/subregliveness-07.mir
+10-10llvm/test/CodeGen/SystemZ/regcoal-subranges-update.mir
+7-7llvm/test/CodeGen/SystemZ/twoaddr-kill.mir
+80-1578 files not shown
+111-18814 files

LLVM/project 93876c5 — libunwind/src Unwind-sjlj.c, llvm/lib/CodeGen SjLjEHPrepare.cpp

libunwind: Use libgcc's function context layout for sjlj

Make call_site an i32 and the __data words pointer
sized. compiler-rt's SjLj_Function_Context was not defined in the same
way as libgcc.

This was broken for all 64-bit targets. Every field was i32, so the
exception pointer in __data[0] was truncated. It just happens that no
64-bit target defaults to SJLJ exceptions except VE. Instead of fixing
that, a VE special case was introduced in the libunwind sources and
SjLjEHPrepare, which had a special TargetMachine hook for this data
size. In reality it should just be a uintptr_t which we can already
infer from the DataLayout.

This is an ABI break for 64-bit targets other than VE when using
libunwind built for SjLj: the __data, personality, lsda and jbuf
offsets move, so compiled code and libunwind must be updated
together. That configuration was already broken by the pointer
truncation and is not the default anywhere. 32-bit targets are

    [4 lines not shown]
DeltaFile
+24-24llvm/test/CodeGen/X86/indirect-branch-tracking-eh2.ll
+34-0llvm/test/Transforms/SjLjEHPrepare/function-context-layout.ll
+7-19libunwind/src/Unwind-sjlj.c
+7-14llvm/lib/CodeGen/SjLjEHPrepare.cpp
+5-5llvm/test/CodeGen/X86/sjlj-eh.ll
+4-4llvm/test/CodeGen/VE/Scalar/builtin_sjlj_callsite.ll
+81-6610 files not shown
+91-8716 files

LLVM/project 4315fa0 — llvm/lib/Transforms/InstCombine InstCombineLoadStoreAlloca.cpp, llvm/test/Transforms/InstCombine merging-multiple-stores-into-successor.ll

[InstCombine] Don't drop provenance when merging stores into successor
DeltaFile
+21-21llvm/test/Transforms/InstCombine/merging-multiple-stores-into-successor.ll
+10-3llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+31-242 files

LLVM/project 6931d20 — llvm/test/Transforms/InstCombine merging-multiple-stores-into-successor.ll

[InstCombine] Pre-commit tests for provenance when merging stores into successor
DeltaFile
+279-6llvm/test/Transforms/InstCombine/merging-multiple-stores-into-successor.ll
+279-61 files

LLVM/project 9e8e893 — llvm/test/CodeGen/AMDGPU scale-offset-global.ll

[AMDGPU] Reword zext scale_offset test comment

SelectionDAG keeps scale_offset in this test only because it narrows
the mask to the demanded bits first. GlobalISel keeps the wider mask,
whose shift can wrap. The old comment suggested that GlobalISel misses
a proof.
DeltaFile
+2-1llvm/test/CodeGen/AMDGPU/scale-offset-global.ll
+2-11 files

LLVM/project 8a8e72b — llvm/include/llvm/IR IntrinsicsAMDGPU.td, llvm/lib/Target/AMDGPU AMDGPUInstCombineIntrinsic.cpp SIISelLowering.cpp

[AMDGPU] Only demand the exponent bits of V_CVT_SCALEF32 scale operands (#229889)

The `V_CVT_SCALEF32_*` conversions from F32/F16/BF16 to
FP8/BF8/FP6/BF6/FP4 only read the exponent field (bits [30:23]) of their
f32 scale operand. This is documented in the CDNA4/CDNA5 ISA.

Frontends that build the scale from an E8M0 byte or an fp32 value often
mask or shift it first, e.g. `and %x, 0x7f800000` or `shl (zext i8
%e8m0), 23`, and those instructions currently survive to the final ISA.
Frontends like Triton lower straight to the ROCDL intrinsics, so the
logic in ArithToAMDGPU that works around this, doesn't reach them. Those
instructions are wasted work in the scale computation of kernels. This
patch tags the down-conversion intrinsics with a new
`AMDGPUExponentOnlyScale<ScaleArg>` class and adds a searchable table
that maps each intrinsic to its scale argument
(`AMDGPU::getExponentOnlyScaleArgIdx`). In InstCombine, the scale
operand drops any `fneg`, `fabs` or `copysign`. When the scale is a
bitcast of an i32 and every user of the bitcast is one of these scale
operands, the i32 is simplified with only the exponent bits demanded. In

    [3 lines not shown]
DeltaFile
+376-0llvm/test/Transforms/InstCombine/AMDGPU/cvt-scalef32-scale-demanded-bits.ll
+278-0llvm/test/CodeGen/AMDGPU/cvt-scalef32-scale-demanded-bits-gfx950.ll
+222-0llvm/test/CodeGen/AMDGPU/cvt-scalef32-scale-demanded-bits-gfx1250.ll
+44-28llvm/include/llvm/IR/IntrinsicsAMDGPU.td
+33-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+25-0llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+978-284 files not shown
+1,026-2810 files

LLVM/project 409ce4d — llvm/test/Transforms/LoopUnrollAndJam reduction.ll

fixup! [LoopUnrollAndJam] Jamming Outside Loop for stencil
DeltaFile
+11-8llvm/test/Transforms/LoopUnrollAndJam/reduction.ll
+11-81 files

LLVM/project ba07ac0 — clang/docs SafeBuffers.md index.md, clang/docs/BoundsSafety BoundsSafetyImplPlans.md BoundsSafetyUpstreamStatus.md

[BoundsSafety][Docs] Add an index page and upstream status for -fbounds-safety

Add BoundsSafety/index.md as the landing page for the -fbounds-safety
docs. It covers how to contribute, standardization efforts in WG14,
open-source adoption efforts, RFCs, and talks.

Add BoundsSafetyUpstreamStatus.md, which lists what is available
upstream, what is in progress, and what is planned, with links to the
relevant PRs and issues.

Leave a stub at the old BoundsSafety.html location so existing links keep
working.

Assisted-by: Opus 5.5
DeltaFile
+97-0clang/docs/BoundsSafety/index.md
+47-0clang/docs/BoundsSafety/BoundsSafetyUpstreamStatus.md
+7-0clang/docs/BoundsSafety.md
+1-3clang/docs/index.md
+1-2clang/docs/BoundsSafety/BoundsSafetyImplPlans.md
+1-1clang/docs/SafeBuffers.md
+154-61 files not shown
+155-77 files

LLVM/project 40a8496 — libunwind/src Unwind-sjlj.c, llvm/lib/CodeGen SjLjEHPrepare.cpp

libunwind: Use libgcc's function context layout for sjlj

Make call_site an i32 and the __data words pointer
sized. compiler-rt's SjLj_Function_Context was not defined in the same
way as libgcc.

This was broken for all 64-bit targets. Every field was i32, so the
exception pointer in __data[0] was truncated. It just happens that no
64-bit target defaults to SJLJ exceptions except VE. Instead of fixing
that, a VE special case was introduced in the libunwind sources and
SjLjEHPrepare, which had a special TargetMachine hook for this data
size. In reality it should just be a uintptr_t which we can already
infer from the DataLayout.

This is an ABI break for 64-bit targets other than VE when using
libunwind built for SjLj: the __data, personality, lsda and jbuf
offsets move, so compiled code and libunwind must be updated
together. That configuration was already broken by the pointer
truncation and is not the default anywhere. 32-bit targets are

    [4 lines not shown]
DeltaFile
+24-24llvm/test/CodeGen/X86/indirect-branch-tracking-eh2.ll
+34-0llvm/test/Transforms/SjLjEHPrepare/function-context-layout.ll
+7-19libunwind/src/Unwind-sjlj.c
+7-14llvm/lib/CodeGen/SjLjEHPrepare.cpp
+5-5llvm/test/CodeGen/X86/sjlj-eh.ll
+4-4llvm/test/CodeGen/VE/Scalar/builtin_sjlj_callsite.ll
+81-6610 files not shown
+91-8716 files