Skip to content

Commit 5136f47

Browse files
committed
CodeGen: Fix livein calculation in MachineBasicBlock splitAt
Fix and simplify computation of liveins for new block. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D88535
1 parent c4690b0 commit 5136f47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/CodeGen/MachineBasicBlock.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,10 @@ MachineBasicBlock *MachineBasicBlock::splitAt(MachineInstr &MI,
961961
if (UpdateLiveIns) {
962962
// Make sure we add any physregs we define in the block as liveins to the
963963
// new block.
964+
MachineBasicBlock::iterator Prev(&MI);
964965
LiveRegs.init(*MF->getSubtarget().getRegisterInfo());
965966
LiveRegs.addLiveOuts(*this);
966-
for (auto I = rbegin(), E = SplitPoint.getReverse(); I != E; ++I)
967+
for (auto I = rbegin(), E = Prev.getReverse(); I != E; ++I)
967968
LiveRegs.stepBackward(*I);
968969
}
969970

llvm/test/CodeGen/AMDGPU/si-lower-control-flow.mir

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ body: |
233233
; GCN: $exec = S_OR_B64_term $exec, [[COPY3]], implicit-def $scc
234234
; GCN: bb.3:
235235
; GCN: successors: %bb.2(0x80000000)
236-
; GCN: liveins: $vgpr3
237236
; GCN: $vgpr3 = V_MOV_B32_e32 0, implicit $exec
238237
; GCN: $sgpr4_sgpr5 = S_MOV_B64 32
239238
; GCN: bb.2:

0 commit comments

Comments
 (0)