From 077415e84b60220421264ecfc11942e97218e688 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 23 Jul 2009 05:44:24 +0000 Subject: [PATCH] For real this time: PHI Def & Kill tracking added to PHIElimination. llvm-svn: 76865 --- llvm/lib/CodeGen/PHIElimination.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp index 1cbe798..56dca08 100644 --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/lib/CodeGen/PHIElimination.cpp @@ -50,6 +50,8 @@ void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const { bool llvm::PHIElimination::runOnMachineFunction(MachineFunction &Fn) { MRI = &Fn.getRegInfo(); + PHIDefs.clear(); + PHIKills.clear(); analyzePHINodes(Fn); bool Changed = false; @@ -183,8 +185,8 @@ void llvm::PHIElimination::LowerAtomicPHINode( } // Record PHI def. - //assert(!hasPHIDef(DestReg) && "Vreg has multiple phi-defs?"); - //PHIDefs[DestReg] = &MBB; + assert(!hasPHIDef(DestReg) && "Vreg has multiple phi-defs?"); + PHIDefs[DestReg] = &MBB; // Update live variable information if there is any. LiveVariables *LV = getAnalysisIfAvailable(); @@ -232,7 +234,7 @@ void llvm::PHIElimination::LowerAtomicPHINode( MachineBasicBlock &opBlock = *MPhi->getOperand(i*2+2).getMBB(); // Record the kill. - //PHIKills[SrcReg].insert(&opBlock); + PHIKills[SrcReg].insert(&opBlock); // If source is defined by an implicit def, there is no need to insert a // copy. -- 2.7.4