summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorCarl Ritson <carl.ritson@amd.com>2020-10-02 09:58:36 +0900
committerCarl Ritson <carl.ritson@amd.com>2020-10-02 10:45:04 +0900
commit5136f4748a2b3302da581f6140ca453bb37f11e9 (patch)
treefbea89c57c062c7a29f252eb6345dc5f5dc95fe5 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentc4690b007743d2f564bc1156fdbdbcaad2adddcc (diff)
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
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 8a37a1e9d6f2..6272adcf114d 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -961,9 +961,10 @@ MachineBasicBlock *MachineBasicBlock::splitAt(MachineInstr &MI,
if (UpdateLiveIns) {
// Make sure we add any physregs we define in the block as liveins to the
// new block.
+ MachineBasicBlock::iterator Prev(&MI);
LiveRegs.init(*MF->getSubtarget().getRegisterInfo());
LiveRegs.addLiveOuts(*this);
- for (auto I = rbegin(), E = SplitPoint.getReverse(); I != E; ++I)
+ for (auto I = rbegin(), E = Prev.getReverse(); I != E; ++I)
LiveRegs.stepBackward(*I);
}