AMDGPU: Rework how private buffer passed for HSA
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 30 Nov 2015 21:16:03 +0000 (21:16 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 30 Nov 2015 21:16:03 +0000 (21:16 +0000)
commit0f1b95f8188f2c2ce4a93394ca185c707463c75e
tree90d6b2f7f41603a92c3d027040579d1aeeccbc34
parentd4a0a430cc9eca9157aed5751616515db30b8b39
AMDGPU: Rework how private buffer passed for HSA

If we know we have stack objects, we reserve the registers
that the private buffer resource and wave offset are passed
and use them directly.

If not, reserve the last 5 SGPRs just in case we need to spill.
After register allocation, try to pick the next available registers
instead of the last SGPRs, and then insert copies from the inputs
to the reserved registers in the progloue.

This also only selectively enables all of the input registers
which are really required instead of always enabling them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254331 91177308-0d34-0410-b5e6-96231b3b80d8
21 files changed:
lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
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
test/CodeGen/AMDGPU/hsa.ll
test/CodeGen/AMDGPU/large-alloca-compute.ll
test/CodeGen/AMDGPU/large-alloca-graphics.ll
test/CodeGen/AMDGPU/llvm.AMDGPU.read.workdim.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/llvm.amdgcn.dispatch.ptr.ll
test/CodeGen/AMDGPU/llvm.dbg.value.ll
test/CodeGen/AMDGPU/llvm.r600.read.local.size.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/local-memory-two-objects.ll
test/CodeGen/AMDGPU/local-memory.ll
test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot-compute.ll
test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot.ll
test/CodeGen/AMDGPU/work-item-intrinsics.ll