[llvm-commits] [llvm] r76865 - /llvm/trunk/lib/CodeGen/PHIElimination.cpp

Lang Hames lhames at gmail.com
Wed Jul 22 22:44:33 PDT 2009


Author: lhames
Date: Thu Jul 23 00:44:24 2009
New Revision: 76865

URL: http://llvm.org/viewvc/llvm-project?rev=76865&view=rev
Log:
For real this time: PHI Def & Kill tracking added to PHIElimination.

Modified:
    llvm/trunk/lib/CodeGen/PHIElimination.cpp

Modified: llvm/trunk/lib/CodeGen/PHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PHIElimination.cpp?rev=76865&r1=76864&r2=76865&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/PHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/PHIElimination.cpp Thu Jul 23 00:44:24 2009
@@ -50,6 +50,8 @@
 bool llvm::PHIElimination::runOnMachineFunction(MachineFunction &Fn) {
   MRI = &Fn.getRegInfo();
 
+  PHIDefs.clear();
+  PHIKills.clear();
   analyzePHINodes(Fn);
 
   bool Changed = false;
@@ -183,8 +185,8 @@
   }
 
   // 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<LiveVariables>();
@@ -232,7 +234,7 @@
     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.





More information about the llvm-commits mailing list