forked from OSchip/llvm-project
[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
This commit is contained in:
parent
3d12971e1c
commit
6a87e0fc6a
|
@ -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,
|
||||
|
|
|
@ -489,6 +489,7 @@ define amdgpu_kernel void @kern_indirect_use_every_sgpr_input() #1 {
|
|||
; GCN-NOT: s[8:9]
|
||||
; GCN-NOT: s[10:11]
|
||||
; GCN-NOT: s[12:13]
|
||||
; GCN: s_or_saveexec_b64 s[6:7], -1
|
||||
define hidden void @func_indirect_use_every_sgpr_input() #1 {
|
||||
call void @use_every_sgpr_input()
|
||||
ret void
|
||||
|
|
Loading…
Reference in New Issue