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/SplitKit.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/SplitKit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SplitKit.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp index 4c8801a3611..dab1dfe4f1f 100644 --- a/llvm/lib/CodeGen/SplitKit.cpp +++ b/llvm/lib/CodeGen/SplitKit.cpp @@ -623,8 +623,7 @@ void SplitEditor::removeBackCopies(SmallVectorImpl<VNInfo*> &Copies) { AssignI.setMap(RegAssign); for (unsigned i = 0, e = Copies.size(); i != e; ++i) { - VNInfo *VNI = Copies[i]; - SlotIndex Def = VNI->def; + SlotIndex Def = Copies[i]->def; MachineInstr *MI = LIS.getInstructionFromIndex(Def); assert(MI && "No instruction for back-copy"); @@ -635,13 +634,12 @@ void SplitEditor::removeBackCopies(SmallVectorImpl<VNInfo*> &Copies) { while (!AtBegin && (--MBBI)->isDebugValue()); DEBUG(dbgs() << "Removing " << Def << '\t' << *MI); - LI->removeValNo(VNI); + LIS.removeVRegDefAt(*LI, Def); LIS.RemoveMachineInstrFromMaps(MI); MI->eraseFromParent(); - // Adjust RegAssign if a register assignment is killed at VNI->def. We - // want to avoid calculating the live range of the source register if - // possible. + // Adjust RegAssign if a register assignment is killed at Def. We want to + // avoid calculating the live range of the source register if possible. AssignI.find(Def.getPrevSlot()); if (!AssignI.valid() || AssignI.start() >= Def) continue; |