================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to