From 311730ac7834eb2d1283c86b6303e688343271bd Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 21 Jan 2015 19:02:30 +0000 Subject: LiveIntervalAnalysis: Factor out code to update liveness on vreg def removal This cleans up code and is more in line with the general philosophy of modifying LiveIntervals through LiveIntervalAnalysis instead of changing them directly. This also fixes a case where SplitEditor::removeBackCopies() would miss the subregister ranges. llvm-svn: 226690 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp') diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 48daf2ccd06..c03773f8037 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1375,3 +1375,17 @@ void LiveIntervals::removePhysRegDefAt(unsigned Reg, SlotIndex Pos) { LR->removeValNo(VNI); } } + +void LiveIntervals::removeVRegDefAt(LiveInterval &LI, SlotIndex Pos) { + VNInfo *VNI = LI.getVNInfoAt(Pos); + if (VNI == nullptr) + return; + LI.removeValNo(VNI); + + // Also remove the value in subranges. + for (LiveInterval::SubRange &S : LI.subranges()) { + if (VNInfo *SVNI = S.getVNInfoAt(Pos)) + S.removeValNo(SVNI); + } + LI.removeEmptySubRanges(); +} -- cgit v1.2.3