diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2015-11-30 21:15:53 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2015-11-30 21:15:53 +0000 |
commit | 0e3d38937e11408127c1ae07d89f5189df204405 (patch) | |
tree | cd773950ee36f9811b2a4c50a390a46398f26272 /llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | |
parent | ff6da2fe894f52abcddd7bfbf2a211d51867eb88 (diff) | |
download | bcm5719-llvm-0e3d38937e11408127c1ae07d89f5189df204405.tar.gz bcm5719-llvm-0e3d38937e11408127c1ae07d89f5189df204405.zip |
AMDGPU: Remove SIPrepareScratchRegs
It does not work because of emergency stack slots.
This pass was supposed to eliminate dummy registers for the
spill instructions, but the register scavenger can introduce
more during PrologEpilogInserter, so some would end up
left behind if they were needed.
The potential for spilling the scratch resource descriptor
and offset register makes doing something like this
overly complicated. Reserve registers to use for the resource
descriptor and use them directly in eliminateFrameIndex.
Also removes creating another scratch resource descriptor
when directly selecting scratch MUBUF instructions.
The choice of which registers are reserved is temporary.
For now it attempts to pick the next available registers
after the user and system SGPRs.
llvm-svn: 254329
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp index 6269dce553f..d042844aa13 100644 --- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp @@ -68,6 +68,14 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF) WorkItemIDZ = true; } +void SIMachineFunctionInfo::setScratchRSrcReg(const SIRegisterInfo *TRI) { + // We need to round up to next multiple of 4. + unsigned NextSReg128 = RoundUpToAlignment(NumUserSGPRs + 5, 4); + unsigned RegSub0 = AMDGPU::SReg_32RegClass.getRegister(NextSReg128); + ScratchRSrcReg = TRI->getMatchingSuperReg(RegSub0, AMDGPU::sub0, + &AMDGPU::SReg_128RegClass); +} + SIMachineFunctionInfo::SpilledReg SIMachineFunctionInfo::getSpilledReg( MachineFunction *MF, unsigned FrameIndex, |