[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LICM.cpp ScalarReplAggregates.cpp

Owen Anderson resistor at mac.com
Thu Apr 19 23:27:35 PDT 2007



Changes in directory llvm/lib/Transforms/Scalar:

LICM.cpp updated: 1.92 -> 1.93
ScalarReplAggregates.cpp updated: 1.85 -> 1.86
---
Log message:

Move more passes to using ETForest instead of DominatorTree.


---
Diffs of the changes:  (+5 -8)

 LICM.cpp                 |    7 ++-----
 ScalarReplAggregates.cpp |    6 +++---
 2 files changed, 5 insertions(+), 8 deletions(-)


Index: llvm/lib/Transforms/Scalar/LICM.cpp
diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.92 llvm/lib/Transforms/Scalar/LICM.cpp:1.93
--- llvm/lib/Transforms/Scalar/LICM.cpp:1.92	Wed Apr 18 00:43:13 2007
+++ llvm/lib/Transforms/Scalar/LICM.cpp	Fri Apr 20 01:27:13 2007
@@ -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


Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.85 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.86
--- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.85	Thu Apr 19 00:39:12 2007
+++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp	Fri Apr 20 01:27:13 2007
@@ -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;
   }






More information about the llvm-commits mailing list