[PATCH] D85767: [AMDGPU] Spill register and offset register cannot be same

Mahesha S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 12:01:31 PDT 2020


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

Mark spill register as used so we will not choose it as offset register,
Otherwise, spill register may possibly get killed even before spill


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85767

Files:
  llvm/lib/Target/AMDGPU/SIFrameLowering.cpp


Index: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+++ llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
@@ -158,6 +158,10 @@
     return;
   }
 
+  // Mark spill register as used so we will not choose it as `OffsetReg`,
+  // Otherwise, spill register may possibly get killed even before spill
+  LiveRegs.addReg(SpillReg);
+
   MCPhysReg OffsetReg = findScratchNonCalleeSaveRegister(
     MF->getRegInfo(), LiveRegs, AMDGPU::VGPR_32RegClass);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85767.284842.patch
Type: text/x-patch
Size: 554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200811/8da9c3f5/attachment.bin>


More information about the llvm-commits mailing list