diff options
author | Chris Lattner <sabre@nondot.org> | 2004-05-01 21:24:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-05-01 21:24:39 +0000 |
commit | 015959ee38e4fd4a920f6b0065c50e524762f580 (patch) | |
tree | e8584c9bf4d1d6822cc962534bfb0d056efac61e /lib/CodeGen/PHIElimination.cpp | |
parent | f25fb4bc640340c60793a3e2bbf2510dea0e15f4 (diff) |
Operate on the Machine CFG instead of on the LLVM CFG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13302 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r-- | lib/CodeGen/PHIElimination.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index 324f4c4e85..180cb6d793 100644 --- a/lib/CodeGen/PHIElimination.cpp +++ b/lib/CodeGen/PHIElimination.cpp @@ -20,7 +20,6 @@ #include "llvm/CodeGen/LiveVariables.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Support/CFG.h" #include "Support/STLExtras.h" using namespace llvm; @@ -195,14 +194,12 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) { // at an appropriate point later. // bool ValueIsLive = false; - const BasicBlock *BB = opBlock.getBasicBlock(); - for (succ_const_iterator SI = succ_begin(BB), E = succ_end(BB); - SI != E && !ValueIsLive; ++SI) { - const std::pair<MachineBasicBlock*, unsigned> & - SuccInfo = LV->getBasicBlockInfo(*SI); + for (MachineBasicBlock::succ_iterator SI = opBlock.succ_begin(), + E = opBlock.succ_end(); SI != E && !ValueIsLive; ++SI) { + MachineBasicBlock *MBB = *SI; // Is it alive in this successor? - unsigned SuccIdx = SuccInfo.second; + unsigned SuccIdx = LV->getMachineBasicBlockIndex(MBB); if (SuccIdx < InRegVI.AliveBlocks.size() && InRegVI.AliveBlocks[SuccIdx]) { ValueIsLive = true; @@ -210,7 +207,6 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) { } // Is it killed in this successor? - MachineBasicBlock *MBB = SuccInfo.first; for (unsigned i = 0, e = InRegVI.Kills.size(); i != e; ++i) if (InRegVI.Kills[i].first == MBB) { ValueIsLive = true; |