[PATCH] D115551: [AMDGPU] Do not reserve any VGPR for SGPR spills

Austin Kerbow via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 10 13:45:06 PST 2021


kerbowa created this revision.
kerbowa added reviewers: arsenm, rampitec, RamNalamothu, cdevadas, saiislam.
Herald added subscribers: foad, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, qcolombet, MatzeB.
kerbowa requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

After the split register allocation changes in eebe841a47cb <https://reviews.llvm.org/rGeebe841a47cbbd55bdcc32da943c92d18f88a5b8> it is no
longer necessary to reserve a VGPR before RA. This can also create bugs
when IPRA is enabled since we cannot predict that a called function may
not reserve any register if it does not have any SGPR spills. If that
happens those functions may override reserved registers that are
normally callee saved. Added a test to show this.

Fixes: SWDEV-309900


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115551

Files:
  llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
  llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
  llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
  llvm/test/CodeGen/AMDGPU/GlobalISel/extractelement-stack-lower.ll
  llvm/test/CodeGen/AMDGPU/reserve-vgpr-for-sgpr-spill.ll
  llvm/test/CodeGen/AMDGPU/sgpr-spills-split-regalloc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115551.393584.patch
Type: text/x-patch
Size: 32670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211210/1879b458/attachment-0001.bin>


More information about the llvm-commits mailing list