diff options
author | Matthias Braun <matze@braunis.de> | 2015-01-21 19:02:30 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2015-01-21 19:02:30 +0000 |
commit | 311730ac7834eb2d1283c86b6303e688343271bd (patch) | |
tree | e2e90a8aa8457b5aec80d26f73ad29277b62c828 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | e1b7da7134cee5bcd5d991b1d6e99f3c6642a9da (diff) | |
download | bcm5719-llvm-311730ac7834eb2d1283c86b6303e688343271bd.tar.gz bcm5719-llvm-311730ac7834eb2d1283c86b6303e688343271bd.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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(); +} |