AMDGPU: Implement SGPR spilling with scalar stores
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sun, 13 Nov 2016 18:20:54 +0000 (18:20 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Sun, 13 Nov 2016 18:20:54 +0000 (18:20 +0000)
commitdc45274d546b531ca64308cfe4304042e341c463
treeb70f3b53f74a692128c5fd8b8f21618a9a4e75d0
parente2399f9e0e0272ad12f649c8eff0da49dcbf2068
AMDGPU: Implement SGPR spilling with scalar stores

nThis avoids the nasty problems caused by using
memory instructions that read the exec mask while
spilling / restoring registers used for control flow
masking, but only for VI when these were added.

This always uses the scalar stores when enabled currently,
but it may be better to still try to spill to a VGPR
and use this on the fallback memory path.

The cache also needs to be flushed before wave termination
if a scalar store is used.

llvm-svn: 286766
llvm/lib/Target/AMDGPU/SIInsertWaits.cpp
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
llvm/test/CodeGen/AMDGPU/attr-amdgpu-num-sgpr.ll
llvm/test/CodeGen/AMDGPU/basic-branch.ll
llvm/test/CodeGen/AMDGPU/si-spill-sgpr-stack.ll
llvm/test/CodeGen/AMDGPU/spill-m0.ll
llvm/test/CodeGen/MIR/AMDGPU/scalar-store-cache-flush.mir [new file with mode: 0644]