[PATCH] D47509: [AMDGPU] Track occupancy in MFI

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 30 01:36:38 PDT 2018


rampitec added inline comments.


================
Comment at: lib/Target/AMDGPU/SIISelLowering.cpp:4258-4262
+    SDValue Res = AMDGPUTargetLowering::LowerGlobalAddress(MFI, Op, DAG);
+    MachineFunction &MF = DAG.getMachineFunction();
+    SIMachineFunctionInfo *MFI = MF.getInfo<SIMachineFunctionInfo>();
+    MFI->limitOccupancy(MF);
+    return Res;
----------------
rampitec wrote:
> arsenm wrote:
> > Why is this here?
> allocateLDSGlobal() belongs to AMDGPUMachineFunction, not SIMachineFunctionInfo. The choice is to either make it virtual or handle in the single place it is really used.
In fact the other choice is to create SIMachineFunctionInfo::allocateLDSGlobal() which will call AMDGPUMachineFunction::allocateLDSGlobal() and then limitOccupancy(), then call it from here. Same thing basically, but more obscure to my taste. The only sound solution is to virtualize MFI, but I am not really sure it is worth it.


https://reviews.llvm.org/D47509





More information about the llvm-commits mailing list