summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-06-05 22:20:47 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-06-05 22:20:47 +0000
commitb812b7a45ed159fcc4b1b26f9200885d93b68fc5 (patch)
tree24ec293bca8be1a5b15f1e58c37f2615b2e667ab /llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll
parent8f500a6f9ca0e56e41513435d0257c84ddabb566 (diff)
downloadbcm5719-llvm-b812b7a45ed159fcc4b1b26f9200885d93b68fc5.tar.gz
bcm5719-llvm-b812b7a45ed159fcc4b1b26f9200885d93b68fc5.zip
AMDGPU: Invert frame index offset interpretation
Since the beginning, the offset of a frame index has been consistently interpreted backwards. It was treating it as an offset from the scratch wave offset register as a frame register. The correct interpretation is the offset from the SP on entry to the function, before the prolog. Frame index elimination then should select either SP or another register as an FP. Treat the scratch wave offset on kernel entry as the pre-incremented SP. Rely more heavily on the standard hasFP and frame pointer elimination logic, and clean up the private reservation code. This saves a copy in most callee functions. The kernel prolog emission code is still kind of a mess relying on checking the uses of physical registers, which I would prefer to eliminate. Currently selection directly emits MUBUF instructions, which require using a reference to some register. Use the register chosen for SP, and then ignore this later. This should probably be cleaned up to use pseudos that don't refer to any specific base register until frame index elimination. Add a workaround for shaders using large numbers of SGPRs. I'm not sure these cases were ever working correctly, since as far as I can tell the logic for figuring out which SGPR is the scratch wave offset doesn't match up with the shader input initialization in the shader programming guide. llvm-svn: 362661
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll')
-rw-r--r--llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll b/llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll
index 57722e202bc..972d4e6692b 100644
--- a/llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll
+++ b/llvm/test/CodeGen/AMDGPU/spill-offset-calculation.ll
@@ -171,7 +171,7 @@ entry:
%aptr = getelementptr i32, i32 addrspace(5)* %buf, i32 1
; 0x40000 / 64 = 4096 (for wave64)
- ; CHECK: s_add_u32 s6, s5, 0x40000
+ ; CHECK: s_add_u32 s6, s32, 0x40000
; CHECK: buffer_store_dword v{{[0-9]+}}, off, s[{{[0-9]+:[0-9]+}}], s6 ; 4-byte Folded Spill
%a = load volatile i32, i32 addrspace(5)* %aptr
@@ -223,7 +223,7 @@ entry:
%bufv2 = bitcast i8 addrspace(5)* %alloca to <2 x i32> addrspace(5)*
; 0x3ff00 / 64 = 4092 (for wave64)
- ; CHECK: s_add_u32 s6, s5, 0x3ff00
+ ; CHECK: s_add_u32 s6, s32, 0x3ff00
; CHECK: buffer_store_dword v{{[0-9]+}}, off, s[{{[0-9]+:[0-9]+}}], s6 ; 4-byte Folded Spill
; CHECK: buffer_store_dword v{{[0-9]+}}, off, s[{{[0-9]+:[0-9]+}}], s6 offset:4 ; 4-byte Folded Spill
%aptr = getelementptr <2 x i32>, <2 x i32> addrspace(5)* %bufv2, i32 1
OpenPOWER on IntegriCloud