Move more passes to using ETForest instead of DominatorTree.

llvm-svn: 36271
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index c9ade928..3b71497 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -73,7 +73,6 @@
       AU.addRequiredID(LoopSimplifyID);
       AU.addRequired<LoopInfo>();
       AU.addRequired<ETForest>();
-      AU.addRequired<DominatorTree>();      // For scalar promotion (mem2reg)
       AU.addRequired<DominanceFrontier>();  // For scalar promotion (mem2reg)
       AU.addRequired<AliasAnalysis>();
     }
@@ -88,7 +87,6 @@
     AliasAnalysis *AA;       // Current AliasAnalysis information
     LoopInfo      *LI;       // Current LoopInfo
     ETForest *ET;       // ETForest for the current Loop...
-    DominatorTree *DT;       // Dominator Tree for the current Loop...
     DominanceFrontier *DF;   // Current Dominance Frontier
 
     // State that is updated as we process loops
@@ -215,7 +213,6 @@
   AA = &getAnalysis<AliasAnalysis>();
   DF = &getAnalysis<DominanceFrontier>();
   ET = &getAnalysis<ETForest>();
-  DT = &getAnalysis<DominatorTree>();
 
   CurAST = new AliasSetTracker(*AA);
   // Collect Alias info frmo subloops
@@ -554,7 +551,7 @@
     if (AI) {
       std::vector<AllocaInst*> Allocas;
       Allocas.push_back(AI);
-      PromoteMemToReg(Allocas, *DT, *DF, AA->getTargetData(), CurAST);
+      PromoteMemToReg(Allocas, *ET, *DF, AA->getTargetData(), CurAST);
     }
   }
 }
@@ -735,7 +732,7 @@
   PromotedAllocas.reserve(PromotedValues.size());
   for (unsigned i = 0, e = PromotedValues.size(); i != e; ++i)
     PromotedAllocas.push_back(PromotedValues[i].first);
-  PromoteMemToReg(PromotedAllocas, *DT, *DF, AA->getTargetData(), CurAST);
+  PromoteMemToReg(PromotedAllocas, *ET, *DF, AA->getTargetData(), CurAST);
 }
 
 /// FindPromotableValuesInLoop - Check the current loop for stores to definite
diff --git a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
index 5bbb5ae..6e9dc03 100644
--- a/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
+++ b/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
@@ -53,7 +53,7 @@
     // getAnalysisUsage - This pass does not require any passes, but we know it
     // will not alter the CFG, so say so.
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-      AU.addRequired<DominatorTree>();
+      AU.addRequired<ETForest>();
       AU.addRequired<DominanceFrontier>();
       AU.addRequired<TargetData>();
       AU.setPreservesCFG();
@@ -100,7 +100,7 @@
 bool SROA::performPromotion(Function &F) {
   std::vector<AllocaInst*> Allocas;
   const TargetData &TD = getAnalysis<TargetData>();
-  DominatorTree     &DT = getAnalysis<DominatorTree>();
+  ETForest         &ET = getAnalysis<ETForest>();
   DominanceFrontier &DF = getAnalysis<DominanceFrontier>();
 
   BasicBlock &BB = F.getEntryBlock();  // Get the entry node for the function
@@ -119,7 +119,7 @@
 
     if (Allocas.empty()) break;
 
-    PromoteMemToReg(Allocas, DT, DF, TD);
+    PromoteMemToReg(Allocas, ET, DF, TD);
     NumPromoted += Allocas.size();
     Changed = true;
   }