diff options
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIFrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIFrameLowering.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp index 3a956f3e7cd9..d0fd59a4e9c9 100644 --- a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp @@ -1237,16 +1237,8 @@ void SIFrameLowering::processFunctionBeforeFrameFinalized( if (!allStackObjectsAreDead(MFI)) { assert(RS && "RegScavenger required if spilling"); - if (FuncInfo->isEntryFunction()) { - int ScavengeFI = MFI.CreateFixedObject( - TRI->getSpillSize(AMDGPU::SGPR_32RegClass), 0, false); - RS->addScavengingFrameIndex(ScavengeFI); - } else { - int ScavengeFI = MFI.CreateStackObject( - TRI->getSpillSize(AMDGPU::SGPR_32RegClass), - TRI->getSpillAlign(AMDGPU::SGPR_32RegClass), false); - RS->addScavengingFrameIndex(ScavengeFI); - } + // Add an emergency spill slot + RS->addScavengingFrameIndex(FuncInfo->getScavengeFI(MFI, *TRI)); } } |