aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/PHIElimination.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-23 23:42:17 +0000
committerChris Lattner <sabre@nondot.org>2005-08-23 23:42:17 +0000
commit44b94c2185f4c1b826ec6003d25370cf2efac219 (patch)
tree448157d9d176d3ba861114daf247fd4dec1c270d /lib/CodeGen/PHIElimination.cpp
parentd1775798607f12b31dc2fc186312673ff417eadd (diff)
adjust to new live variables interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r--lib/CodeGen/PHIElimination.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index 7473c5c22f..7b66bcfaa2 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -125,19 +125,14 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
// of any registers, or if the value itself is dead, we need to move this
// information over to the new copy we just inserted.
//
- std::pair<LiveVariables::killed_iterator, LiveVariables::killed_iterator>
- RKs = LV->killed_range(MPhi);
- std::vector<std::pair<MachineInstr*, unsigned> > Range;
- if (RKs.first != RKs.second) // Delete the range.
- LV->removeVirtualRegistersKilled(RKs.first, RKs.second);
+ LV->removeVirtualRegistersKilled(MPhi);
- RKs = LV->dead_range(MPhi);
+ std::pair<LiveVariables::killed_iterator, LiveVariables::killed_iterator>
+ RKs = LV->dead_range(MPhi);
if (RKs.first != RKs.second) {
- // Works as above...
- Range.assign(RKs.first, RKs.second);
- LV->removeVirtualRegistersDead(RKs.first, RKs.second);
- for (unsigned i = 0, e = Range.size(); i != e; ++i)
- LV->addVirtualRegisterDead(Range[i].second, PHICopy);
+ for (LiveVariables::killed_iterator I = RKs.first; I != RKs.second; ++I)
+ LV->addVirtualRegisterDead(*I, PHICopy);
+ LV->removeVirtualRegistersDead(MPhi);
}
}