From 8c0bc68910e575328a7d34143770ee9d8924e251 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 1 May 2004 21:24:39 +0000 Subject: Operate on the Machine CFG instead of on the LLVM CFG llvm-svn: 13302 --- llvm/lib/CodeGen/PHIElimination.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'llvm/lib/CodeGen/PHIElimination.cpp') 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 & - 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; -- cgit v1.2.3