diff options
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 280ced6..f7beb51 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -1275,6 +1275,8 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge( assert(VNI && "PHI sources should be live out of their predecessors."); LI.addSegment(LiveInterval::Segment(StartIndex, EndIndex, VNI)); + for (auto &SR : LI.subranges()) + SR.addSegment(LiveInterval::Segment(StartIndex, EndIndex, VNI)); } } } @@ -1294,8 +1296,18 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge( VNInfo *VNI = LI.getVNInfoAt(PrevIndex); assert(VNI && "LiveInterval should have VNInfo where it is live."); LI.addSegment(LiveInterval::Segment(StartIndex, EndIndex, VNI)); + // Update subranges with live values + for (auto &SR : LI.subranges()) { + VNInfo *VNI = SR.getVNInfoAt(PrevIndex); + if (VNI) + SR.addSegment(LiveInterval::Segment(StartIndex, EndIndex, VNI)); + } } else if (!isLiveOut && !isLastMBB) { LI.removeSegment(StartIndex, EndIndex); + for (auto &SR : LI.subranges()) { + if (SR.overlaps(StartIndex, EndIndex)) + SR.removeSegment(StartIndex, EndIndex); + } } } |