X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FPHIElimination.cpp;h=0010ccd7e66fe0320c4df7c3f3d956514008aeea;hb=da8d96d1a1769d0614c46d9880ac3c21cbc8e74c;hp=ebb3ae2b383dd2b092bdc8605a95036b55668d69;hpb=a7bfbba856f6fc99803c9a670fd110d7a72f4843;p=oota-llvm.git diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index ebb3ae2b383..0010ccd7e66 100644 --- a/lib/CodeGen/PHIElimination.cpp +++ b/lib/CodeGen/PHIElimination.cpp @@ -20,8 +20,8 @@ #include "llvm/CodeGen/LiveVariables.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetMachine.h" -#include "Support/DenseMap.h" -#include "Support/STLExtras.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/STLExtras.h" using namespace llvm; namespace { @@ -131,18 +131,9 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) { std::pair RKs = LV->killed_range(MPhi); std::vector > Range; - if (RKs.first != RKs.second) { - // Copy the range into a vector... - Range.assign(RKs.first, RKs.second); - - // Delete the range... + if (RKs.first != RKs.second) // Delete the range. LV->removeVirtualRegistersKilled(RKs.first, RKs.second); - // Add all of the kills back, which will update the appropriate info... - for (unsigned i = 0, e = Range.size(); i != e; ++i) - LV->addVirtualRegisterKilled(Range[i].second, PHICopy); - } - RKs = LV->dead_range(MPhi); if (RKs.first != RKs.second) { // Works as above... @@ -252,6 +243,11 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) { if (!ValueIsLive) { MachineBasicBlock::iterator Prev = prior(I); LV->addVirtualRegisterKilled(SrcReg, Prev); + + // This vreg no longer lives all of the way through opBlock. + unsigned opBlockNum = opBlock.getNumber(); + if (opBlockNum < InRegVI.AliveBlocks.size()) + InRegVI.AliveBlocks[opBlockNum] = false; } } }