================
@@ -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);
----------------
perlfu wrote:
This is just retrieving the metadata set by the earlier, right? So isn't
allocating.
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