AMDGPU: Remove SIPrepareScratchRegs
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 30 Nov 2015 21:15:53 +0000 (21:15 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 30 Nov 2015 21:15:53 +0000 (21:15 +0000)
commit956f59ab56fcbaf4256b6dc92dc6d8a9ac592365
tree4d918f968bf27c1745e92cb26d781b166d96e499
parent32851c191d611f67e22dea11f0c1a0adee584806
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254329 91177308-0d34-0410-b5e6-96231b3b80d8
19 files changed:
lib/Target/AMDGPU/AMDGPU.h
lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
lib/Target/AMDGPU/CMakeLists.txt
lib/Target/AMDGPU/SIFrameLowering.cpp
lib/Target/AMDGPU/SIFrameLowering.h
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/SIISelLowering.h
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
lib/Target/AMDGPU/SIPrepareScratchRegs.cpp [deleted file]
lib/Target/AMDGPU/SIRegisterInfo.cpp
test/CodeGen/AMDGPU/kernel-args.ll
test/CodeGen/AMDGPU/large-alloca-compute.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/large-alloca-graphics.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/large-alloca.ll [deleted file]
test/CodeGen/AMDGPU/si-sgpr-spill.ll
test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot-compute.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot.ll