[PATCH] D152892: [AMDGPU] Remove return VGPRs from callee save list

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 07:14:50 PDT 2023


sebastian-ne accepted this revision.
sebastian-ne added a comment.
This revision is now accepted and ready to land.

LGTM if there are no further concerns from @cdevadas.

Just to check, I suppose calls to functions with that many return values are already handled fine?



================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:1521
         MFI->allocateWWMSpill(MF, MI.getOperand(1).getReg());
+      else if (MI.getOpcode() == AMDGPU::SI_RETURN ||
+               MI.getOpcode() == AMDGPU::SI_RETURN_TO_EPILOG) {
----------------
cdevadas wrote:
> I assume this is only a short-term fix until revising the gfx ABI to move return VGPRs into the scratch regs range to avoid the CSR spills/restores.
I think this is a long-term solution :)
Callee-saves have the striped pattern, which is good and what we want.
But if a function decides that it wants to return a lot of values – and they fit into registers – then why not use these registers for the return value, even if they are callee-save (just that they cannot be callee-save for this function return).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152892



More information about the llvm-commits mailing list