From: Chris Lattner Date: Fri, 23 Jul 2004 05:27:43 +0000 (+0000) Subject: Update live intervals more accurately for PHI elim. This slightly reduces X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=94881e8c4522e368df38275d28c8ececdd1e171e;p=oota-llvm.git Update live intervals more accurately for PHI elim. This slightly reduces the live intervals for some registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15125 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp index ebb3ae2b383..4df9a92bb45 100644 --- a/lib/CodeGen/PHIElimination.cpp +++ b/lib/CodeGen/PHIElimination.cpp @@ -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; } } }