[llvm-branch-commits] [llvm] [AMDGPU] Allocate and reserve registers for address space 13 objects (PR #214248)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Nov 2 20:53:04 PST 2026
================
@@ -10253,6 +10272,19 @@ SDValue SITargetLowering::LowerGlobalAddress(AMDGPUMachineFunctionInfo *MFI,
MachineMemOperand::MOInvariant);
}
+// The address is where AMDGPUPromoteAlloca placed the object, recorded on the
+// alloca. Every other frame index keeps its default lowering.
+SDValue SITargetLowering::lowerFrameIndex(SDValue Op, SelectionDAG &DAG) const {
+ MachineFunction &MF = DAG.getMachineFunction();
+ int FI = cast<FrameIndexSDNode>(Op)->getIndex();
+ const AllocaInst *Alloca = MF.getFrameInfo().getObjectAllocation(FI);
+ if (!Alloca || Alloca->getAddressSpace() != AMDGPUAS::VGPR)
+ return SDValue();
+
+ const auto &MD = AMDGPU::AllocatedVGPRsMetadata::get(*Alloca);
----------------
arsenm wrote:
Allocating resources in the DAG isn't great. The ordering is problematic, this won't achieve optimal layout
https://github.com/llvm/llvm-project/pull/214248
More information about the llvm-branch-commits
mailing list