AMDGPU: Fix FP restore from being reordered with stack ops
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 27 Mar 2018 18:38:51 +0000 (18:38 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 27 Mar 2018 18:38:51 +0000 (18:38 +0000)
commite9f36790310a7b5a05dc134ece554fd75e2d98a9
treefb2184ca296c13f451eb2ae3b5f1ddca2746050c
parent01c33b818950af40a7bd2089211a24db8c1f7dd0
AMDGPU: Fix FP restore from being reordered with stack ops

In a function, s5 is used as the frame base SGPR. If a function
is calling another function, during the call sequence
it is copied to a preserved SGPR and restored.

Before it was possible for the scheduler to move stack operations
before the restore of s5, since there's nothing to associate
a frame index access with the restore.

Add an implicit use of s5 to the adjcallstack pseudo which ends
the call sequence to preven this from happening. I'm not 100%
satisfied with this solution, but I'm not sure what else would be
better.

llvm-svn: 328650
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/call-preserved-registers.ll