[PATCH] D96336: [AMDGPU] Save VGPR of whole wave when spilling

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 05:25:57 PST 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h:494-495
 
+  /// When spilling SGPRs, we may need a temporary stack slot to free a VGPR.
+  Optional<int> SpillSGPRTmpIndex;
+
----------------
sebastian-ne wrote:
> arsenm wrote:
> > sebastian-ne wrote:
> > > arsenm wrote:
> > > > Why doesn't this use the normal emergency stack slot?
> > > How do I get the emergency stack slot?
> > You don't get it, it just is what automatically happens when you attempt to use the scavenger and it fails to find a free register. It's possible we would need to add SGPR  spills as one of the conditions where it will be necessary
> Thanks for the explanation. The RegScavenger won’t spill all lanes though. Also, it won’t spill if the register is dead in the currently active lanes (which we want to fix here).
> So, I don’t think using the scavenger works, unless we can tell the RegScavenger to spill the whole wave, and lower that to spill – flip exec – spill – flip exec again.
Even if you don't use it's mechanism, it still has the emergency slot available in the function frame you can re-use


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96336/new/

https://reviews.llvm.org/D96336



More information about the llvm-commits mailing list