Reorder the contents of various getAnalysisUsage functions, eliminating
authorDan Gohman <gohman@apple.com>
Fri, 16 Jul 2010 17:58:45 +0000 (17:58 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 16 Jul 2010 17:58:45 +0000 (17:58 +0000)
a redundant loopsimplify run from the default -O2 sequence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108539 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Utils/LCSSA.cpp
lib/Transforms/Utils/LoopSimplify.cpp

index 73473952912ee59b2aee279b74d9ec43578f166d..b964d7037ab51ae5f51592b99030f5bf741f5592 100644 (file)
@@ -75,10 +75,10 @@ namespace {
     ///
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesCFG();
-      AU.addRequiredID(LoopSimplifyID);
-      AU.addRequired<LoopInfo>();
       AU.addRequired<DominatorTree>();
       AU.addRequired<DominanceFrontier>();  // For scalar promotion (mem2reg)
+      AU.addRequired<LoopInfo>();
+      AU.addRequiredID(LoopSimplifyID);
       AU.addRequired<AliasAnalysis>();
       AU.addPreserved<ScalarEvolution>();
       AU.addPreserved<DominanceFrontier>();
index 16c4a15d3550ae54fcc60deeaaeabd92dc9775cc..313437789a8a139e97cf1fb1f01e1a62d87cb587 100644 (file)
@@ -43,15 +43,15 @@ namespace {
 
     // LCSSA form makes instruction renaming easier.
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+      AU.addPreserved<DominatorTree>();
+      AU.addPreserved<DominanceFrontier>();
+      AU.addRequired<LoopInfo>();
+      AU.addPreserved<LoopInfo>();
       AU.addRequiredID(LoopSimplifyID);
       AU.addPreservedID(LoopSimplifyID);
       AU.addRequiredID(LCSSAID);
       AU.addPreservedID(LCSSAID);
       AU.addPreserved<ScalarEvolution>();
-      AU.addRequired<LoopInfo>();
-      AU.addPreserved<LoopInfo>();
-      AU.addPreserved<DominatorTree>();
-      AU.addPreserved<DominanceFrontier>();
     }
 
     // Helper functions
index e90c30bba78e28072738fb767e0acca6ca4810ef..5967cb9dc1b05d60970f0bf3ef35cf43d6361f6a 100644 (file)
@@ -64,22 +64,18 @@ namespace {
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesCFG();
 
+      AU.addRequiredTransitive<DominatorTree>();
+      AU.addPreserved<DominatorTree>();
+      AU.addPreserved<DominanceFrontier>();
+      AU.addRequiredTransitive<LoopInfo>();
+      AU.addPreserved<LoopInfo>();
+
       // LCSSA doesn't actually require LoopSimplify, but the PassManager
       // doesn't know how to schedule LoopSimplify by itself.
       AU.addRequiredID(LoopSimplifyID);
       AU.addPreservedID(LoopSimplifyID);
-      AU.addRequiredTransitive<LoopInfo>();
-      AU.addPreserved<LoopInfo>();
-      AU.addRequiredTransitive<DominatorTree>();
-      AU.addPreserved<ScalarEvolution>();
-      AU.addPreserved<DominatorTree>();
 
-      // Request DominanceFrontier now, even though LCSSA does
-      // not use it. This allows Pass Manager to schedule Dominance
-      // Frontier early enough such that one LPPassManager can handle
-      // multiple loop transformation passes.
-      AU.addRequired<DominanceFrontier>(); 
-      AU.addPreserved<DominanceFrontier>();
+      AU.addPreserved<ScalarEvolution>();
     }
   private:
     bool ProcessInstruction(Instruction *Inst,
index 4f4edf3a754c118fe807888fa351ebff59ce6619..703689e512ec9b7b905646ed337af2b34037f7a1 100644 (file)
@@ -77,12 +77,19 @@ namespace {
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       // We need loop information to identify the loops...
-      AU.addRequiredTransitive<LoopInfo>();
       AU.addRequiredTransitive<DominatorTree>();
-
-      AU.addPreserved<LoopInfo>();
       AU.addPreserved<DominatorTree>();
+
+      // Request DominanceFrontier now, even though LoopSimplify does
+      // not use it. This allows Pass Manager to schedule Dominance
+      // Frontier early enough such that one LPPassManager can handle
+      // multiple loop transformation passes.
+      AU.addRequired<DominanceFrontier>();
       AU.addPreserved<DominanceFrontier>();
+
+      AU.addRequiredTransitive<LoopInfo>();
+      AU.addPreserved<LoopInfo>();
+
       AU.addPreserved<AliasAnalysis>();
       AU.addPreserved<ScalarEvolution>();
       AU.addPreservedID(BreakCriticalEdgesID);  // No critical edges added.