For real this time: PHI Def & Kill tracking added to PHIElimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76865 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames 2009-07-23 05:44:24 +00:00
parent 7b45fc51aa
commit 20354634eb

View File

@ -50,6 +50,8 @@ void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const {
bool llvm::PHIElimination::runOnMachineFunction(MachineFunction &Fn) { bool llvm::PHIElimination::runOnMachineFunction(MachineFunction &Fn) {
MRI = &Fn.getRegInfo(); MRI = &Fn.getRegInfo();
PHIDefs.clear();
PHIKills.clear();
analyzePHINodes(Fn); analyzePHINodes(Fn);
bool Changed = false; bool Changed = false;
@ -183,8 +185,8 @@ void llvm::PHIElimination::LowerAtomicPHINode(
} }
// Record PHI def. // Record PHI def.
//assert(!hasPHIDef(DestReg) && "Vreg has multiple phi-defs?"); assert(!hasPHIDef(DestReg) && "Vreg has multiple phi-defs?");
//PHIDefs[DestReg] = &MBB; PHIDefs[DestReg] = &MBB;
// Update live variable information if there is any. // Update live variable information if there is any.
LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>(); LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>();
@ -232,7 +234,7 @@ void llvm::PHIElimination::LowerAtomicPHINode(
MachineBasicBlock &opBlock = *MPhi->getOperand(i*2+2).getMBB(); MachineBasicBlock &opBlock = *MPhi->getOperand(i*2+2).getMBB();
// Record the kill. // 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 // If source is defined by an implicit def, there is no need to insert a
// copy. // copy.