diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-06-26 20:35:18 +0000 |
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-06-26 20:35:18 +0000 |
| commit | 6a87e0fc6ab4f71603ccfa5b61394c1fe6f6a44d (patch) | |
| tree | 6464342fd3339125c23b30c8cc05cf031c6bbc29 /llvm/lib/Target/AMDGPU/SIFrameLowering.cpp | |
| parent | 3d12971e1c2ff0f77accb206f368c68befc3a2e6 (diff) | |
| download | bcm5719-llvm-6a87e0fc6ab4f71603ccfa5b61394c1fe6f6a44d.tar.gz bcm5719-llvm-6a87e0fc6ab4f71603ccfa5b61394c1fe6f6a44d.zip | |
[AMDGPU] Fix Livereg computation during epilogue insertion
The LivePhysRegs calculated in order to find a scratch register in the
epilogue code wrongly uses 'LiveIns'. Instead, it should use the
'Liveout' sets. For the liveness, also considering the operands of
the terminator (return) instruction which is the insertion point for
the scratch-exec-copy instruction.
Patch by Christudasan Devadasan
llvm-svn: 364470
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIFrameLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/AMDGPU/SIFrameLowering.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp index 098152b23aa..3ed6d75c045 100644 --- a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp @@ -678,7 +678,8 @@ void SIFrameLowering::emitEpilogue(MachineFunction &MF, if (ScratchExecCopy == AMDGPU::NoRegister) { // See emitPrologue LivePhysRegs LiveRegs(*ST.getRegisterInfo()); - LiveRegs.addLiveIns(MBB); + LiveRegs.addLiveOuts(MBB); + LiveRegs.stepBackward(*MBBI); ScratchExecCopy = findScratchNonCalleeSaveRegister(MF, LiveRegs, |

