* Eliminate the Provided set. All Passes now finally just automatically
authorChris Lattner <sabre@nondot.org>
Mon, 29 Jul 2002 21:03:38 +0000 (21:03 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 29 Jul 2002 21:03:38 +0000 (21:03 +0000)
  provide themselves.

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

include/llvm/Analysis/CallGraph.h
include/llvm/Analysis/DataStructure.h
include/llvm/Analysis/DataStructure/DataStructure.h
include/llvm/Analysis/Dominators.h
include/llvm/Analysis/FindUnsafePointerTypes.h
include/llvm/Analysis/FindUsedTypes.h
include/llvm/Analysis/IntervalPartition.h
include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
lib/VMCore/PassManagerT.h

index 3305c8526e7b2a9fb51e02ca7171badfe8ebca1d..4d24be3dd7b189fd8561a8a0256da265c2f7aa1c 100644 (file)
@@ -132,7 +132,6 @@ public:
   // getAnalysisUsage - This obviously provides a call graph
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
   }
 
   // releaseMemory - Data structures can be large, so free memory aggressively.
index dda0adb214ed90c390437c606de95351bc9ccfc2..a320cf8107fdc5aaf39f145a52a357a18cc06785 100644 (file)
@@ -350,7 +350,6 @@ public:
   // getAnalysisUsage - This obviously provides a data structure graph.
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
   }
 };
 
@@ -385,7 +384,6 @@ public:
   // getAnalysisUsage - This obviously provides a data structure graph.
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
     AU.addRequired(LocalDataStructures::ID);
   }
 private:
@@ -427,7 +425,6 @@ public:
   // getAnalysisUsage - This obviously provides a data structure graph.
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
     AU.addRequired(BUDataStructures::ID);
   }
 private:
index dda0adb214ed90c390437c606de95351bc9ccfc2..a320cf8107fdc5aaf39f145a52a357a18cc06785 100644 (file)
@@ -350,7 +350,6 @@ public:
   // getAnalysisUsage - This obviously provides a data structure graph.
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
   }
 };
 
@@ -385,7 +384,6 @@ public:
   // getAnalysisUsage - This obviously provides a data structure graph.
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
     AU.addRequired(LocalDataStructures::ID);
   }
 private:
@@ -427,7 +425,6 @@ public:
   // getAnalysisUsage - This obviously provides a data structure graph.
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
     AU.addRequired(BUDataStructures::ID);
   }
 private:
index 8c9df644513e919b191d53164e256c448573931c..2beb4ba25e0660674775493e756073c791327644 100644 (file)
@@ -106,7 +106,6 @@ struct DominatorSet : public DominatorSetBase {
   // getAnalysisUsage - This simply provides a dominator set
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
   }
 };
 
@@ -184,7 +183,6 @@ struct ImmediateDominators : public ImmediateDominatorsBase {
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
     AU.addRequired(DominatorSet::ID);
   }
 };
@@ -210,7 +208,6 @@ struct ImmediatePostDominators : public ImmediateDominatorsBase {
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
     AU.addRequired(PostDominatorSet::ID);
-    AU.addProvided(ID);
   }
 };
 
@@ -290,7 +287,6 @@ struct DominatorTree : public DominatorTreeBase {
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
     AU.addRequired(DominatorSet::ID);
   }
 private:
@@ -318,7 +314,6 @@ struct PostDominatorTree : public DominatorTreeBase {
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
     AU.addRequired(PostDominatorSet::ID);
-    AU.addProvided(ID);
   }
 private:
   void calculate(const PostDominatorSet &DS);
@@ -370,7 +365,6 @@ struct DominanceFrontier : public DominanceFrontierBase {
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
     AU.addRequired(DominatorTree::ID);
   }
 private:
@@ -400,7 +394,6 @@ struct PostDominanceFrontier : public DominanceFrontierBase {
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
     AU.addRequired(PostDominatorTree::ID);
-    AU.addProvided(ID);
   }
 private:
   const DomSetType &calculate(const PostDominatorTree &DT,
index 59fc78e3f78287f093f97377a12e2a3ecb4f016f..44c18cbc022493283bcefc2ff5bff9783d47fcff 100644 (file)
@@ -47,7 +47,6 @@ public:
   //
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
   }
 };
 
index 2f3e81c5a68fe26be13dc3422b1414c42341b28d..000e4b7506fb92b8a2991c3454d27ed4be571041 100644 (file)
@@ -46,7 +46,6 @@ public:
   //
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
   }
 };
 
index 4fd388e7c812e45518b708ad465890e9444b4ba4..a295ce1034a3189f99d09c94f36158eda55ac84a 100644 (file)
@@ -73,7 +73,6 @@ public:
   // getAnalysisUsage - Implement the Pass API
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.setPreservesAll();
-    AU.addProvided(ID);
   }
 
 private:
index 719c05ed2309174b0f8cee00c31a95958448ad67..4035dca3fa9502e602d07244260029d6b56258f2 100644 (file)
@@ -23,7 +23,6 @@ public:
   BasicBlock *getExitNode() const { return ExitNode; }
 
   virtual bool runOnFunction(Function &F);
-  virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addProvided(ID); }
 };
 
 static inline Pass *createUnifyFunctionExitNodesPass() {
index 46aefb72f557c9276fc3b7d87c0e849c19701355..6e5fcbdd3e282887347d0112eb9a8c4f221cf578 100644 (file)
@@ -81,7 +81,7 @@ class PassManagerT : public PassManagerTraits<UnitType>,public AnalysisResolver{
   friend typename Traits::SubPassClass;  
   friend class Traits;
 
-  std::vector<PassClass*> Passes;    // List of pass's to run
+  std::vector<PassClass*> Passes;    // List of passes to run
 
   // The parent of this pass manager...
   ParentClass * const Parent;
@@ -160,8 +160,6 @@ public:
                                       (Annotable*)M);
       PMDebug::PrintAnalysisSetInfo(getDepth(), "Preserved", P,
                                     AnUsage.getPreservedSet());
-      PMDebug::PrintAnalysisSetInfo(getDepth(), "Provided", P,
-                                    AnUsage.getProvidedSet());
 
 
       // Erase all analyses not in the preserved set...
@@ -183,11 +181,11 @@ public:
           }
       }
 
-      // Add all analyses in the provided set...
-      for (std::vector<AnalysisID>::const_iterator
-             I = AnUsage.getProvidedSet().begin(),
-             E = AnUsage.getProvidedSet().end(); I != E; ++I)
-        CurrentAnalyses[*I] = P;
+      // Add the current pass to the set of passes that have been run, and are
+      // thus available to users.
+      //
+      if (const PassInfo *PI = P->getPassInfo())
+        CurrentAnalyses[PI] = P;
 
       // Free memory for any passes that we are the last use of...
       std::vector<Pass*> &DeadPass = LastUserOf[P];
@@ -214,7 +212,7 @@ public:
       for (std::map<Pass*, Pass*>::iterator I = LastUseOf.begin(),
                                             E = LastUseOf.end(); I != E; ++I) {
         if (P == I->second) {
-          std::cerr << "Fr" << std::string(Offset*2, ' ');
+          std::cerr << "--" << std::string(Offset*2, ' ');
           I->first->dumpPassStructure(0);
         }
       }
@@ -321,13 +319,13 @@ private:
   //
   void addPass(PassClass *P, AnalysisUsage &AnUsage) {
     const std::vector<AnalysisID> &RequiredSet = AnUsage.getRequiredSet();
-    const std::vector<AnalysisID> &ProvidedSet = AnUsage.getProvidedSet();
 
-    // Providers are analysis classes which are forbidden to modify the module
-    // they are operating on, so they are allowed to be reordered to before the
-    // batcher...
+    // FIXME: If this pass being added isn't killed by any of the passes in the
+    // batcher class then we can reorder to pass to execute before the batcher
+    // does, which will potentially allow us to batch more passes!
     //
-    if (Batcher && ProvidedSet.empty())
+    //const std::vector<AnalysisID> &ProvidedSet = AnUsage.getProvidedSet();
+    if (Batcher /*&& ProvidedSet.empty()*/)
       closeBatcher();                     // This pass cannot be batched!
     
     // Set the Resolver instance variable in the Pass so that it knows where to 
@@ -362,10 +360,9 @@ private:
         }
     }
 
-    // Add all analyses in the provided set...
-    for (std::vector<AnalysisID>::const_iterator I = ProvidedSet.begin(),
-           E = ProvidedSet.end(); I != E; ++I)
-      CurrentAnalyses[*I] = P;
+    // Add this pass to the currently available set...
+    if (const PassInfo *PI = P->getPassInfo())
+      CurrentAnalyses[PI] = P;
 
     // For now assume that our results are never used...
     LastUseOf[P] = P;
@@ -378,7 +375,7 @@ private:
   void addPass(SubPassClass *MP, AnalysisUsage &AnUsage) {
     if (Batcher == 0) // If we don't have a batcher yet, make one now.
       Batcher = new BatcherClass(this);
-    // The Batcher will queue them passes up
+    // The Batcher will queue the passes up
     MP->addToPassManager(Batcher, AnUsage);
   }