[all-commits] [llvm/llvm-project] 5f371b: [AMDGPU] Fold constant offset into SV form address...

Anshil Gandhi via All-commits all-commits at lists.llvm.org
Thu Jul 16 11:40:56 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5f371b2add3e2784e6e9921b42842e2a6622e24e
      https://github.com/llvm/llvm-project/commit/5f371b2add3e2784e6e9921b42842e2a6622e24e
  Author: Anshil Gandhi <95053726+gandhi56 at users.noreply.github.com>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
    M llvm/test/CodeGen/AMDGPU/eliminate-frame-index-flat-scratch-svs.mir

  Log Message:
  -----------
  [AMDGPU] Fold constant offset into SV form addressing in SVS frame index fallback (#208629)

Depends on #208624 (which depends on #208612).

In the SVS fallback path of `SIRegisterInfo::eliminateFrameIndex` for
flat scratch, the scratch address was materialized by moving the full
frame offset into the scavenged vaddr VGPR and forcing the
instruction's immediate offset to `0`, which also silently dropped
any pre-existing immediate offset on the instruction.

This splits the full constant offset with `TII->splitFlatOffset`, folding
as much as possible into the SV form instruction's immediate offset
field and materializing only the remainder (plus the frame register,
if any) into the vaddr VGPR.

Test: adds `scratch_{store,load}_svs_split_offset` to
`eliminate-frame-index-flat-scratch-svs.mir` (non-zero instruction
offset, now preserved and folded) and regenerates the existing checks.

Made with [Cursor](https://cursor.com)

Resolves https://github.com/llvm/llvm-project/issues/178968



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list