OSDN Git Service

AMDGPU: Don't use stack space for SGPR->VGPR spills
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 21 Feb 2017 19:12:08 +0000 (19:12 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 21 Feb 2017 19:12:08 +0000 (19:12 +0000)
commitbcb6a77aca5cf6ac75caec7b21aa58434dded8e2
tree554ee546736b3ed387dd5262bf856a37f81176e6
parent141d242f5af2e2e6b208b672d37ef3c149c3ba41
AMDGPU: Don't use stack space for SGPR->VGPR spills

Before frame offsets are calculated, try to eliminate the
frame indexes used by SGPR spills. Then we can delete them
after.

I think for now we can be sure that no other instruction
will be re-using the same frame indexes. It should be easy
to notice if this assumption ever breaks since everything
asserts if it tries to use a dead frame index later.

The unused emergency stack slot seems to still be left behind,
so an additional 4 bytes is still wasted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295753 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIFrameLowering.cpp
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/SIInstrInfo.cpp
lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
lib/Target/AMDGPU/SIMachineFunctionInfo.h
lib/Target/AMDGPU/SIRegisterInfo.cpp
lib/Target/AMDGPU/SIRegisterInfo.h
lib/Target/AMDGPU/SIRegisterInfo.td
test/CodeGen/AMDGPU/control-flow-fastregalloc.ll
test/CodeGen/AMDGPU/partial-sgpr-to-vgpr-spills.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/si-sgpr-spill.ll