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 | 8c0bc68910e575328a7d34143770ee9d8924e251 (patch) | |
| tree | c160c7cb5ee25aa24284f6af3b366f76337e0552 /llvm/lib/CodeGen/PHIElimination.cpp | |
| parent | c49a9a5d7670265ddf28a5b59004240663650d1f (diff) | |
| download | bcm5719-llvm-8c0bc68910e575328a7d34143770ee9d8924e251.tar.gz bcm5719-llvm-8c0bc68910e575328a7d34143770ee9d8924e251.zip | |
Operate on the Machine CFG instead of on the LLVM CFG
llvm-svn: 13302
Diffstat (limited to 'llvm/lib/CodeGen/PHIElimination.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/PHIElimination.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp index 324f4c4e853..180cb6d7935 100644 --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/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; |

