Fix a funky "declared with greater visibility than the type of its field"
[oota-llvm.git] / lib / CodeGen / PHIElimination.cpp
index 1cbe7989452d11069091cf528de335c9654bb8a5..8071b0a81a89bf0223fa6bf41b221ed7e334faf2 100644 (file)
@@ -41,15 +41,18 @@ X("phi-node-elimination", "Eliminate PHI nodes for register allocation");
 const PassInfo *const llvm::PHIEliminationID = &X;
 
 void llvm::PHIElimination::getAnalysisUsage(AnalysisUsage &AU) const {
-   AU.addPreserved<LiveVariables>();
-   AU.addPreservedID(MachineLoopInfoID);
-   AU.addPreservedID(MachineDominatorsID);
-   MachineFunctionPass::getAnalysisUsage(AU);
- }
+  AU.setPreservesCFG();
+  AU.addPreserved<LiveVariables>();
+  AU.addPreservedID(MachineLoopInfoID);
+  AU.addPreservedID(MachineDominatorsID);
+  MachineFunctionPass::getAnalysisUsage(AU);
+}
 
 bool llvm::PHIElimination::runOnMachineFunction(MachineFunction &Fn) {
   MRI = &Fn.getRegInfo();
 
+  PHIDefs.clear();
+  PHIKills.clear();
   analyzePHINodes(Fn);
 
   bool Changed = false;
@@ -183,8 +186,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<LiveVariables>();
@@ -232,7 +235,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.