diff options
| author | Carl Ritson <carl.ritson@amd.com> | 2020-10-02 09:58:36 +0900 |
|---|---|---|
| committer | Carl Ritson <carl.ritson@amd.com> | 2020-10-02 10:45:04 +0900 |
| commit | 5136f4748a2b3302da581f6140ca453bb37f11e9 (patch) | |
| tree | fbea89c57c062c7a29f252eb6345dc5f5dc95fe5 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
| parent | c4690b007743d2f564bc1156fdbdbcaad2adddcc (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.cpp | 3 |
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); } |
