diff options
author | Chris Lattner <sabre@nondot.org> | 2002-07-29 21:03:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-07-29 21:03:38 +0000 |
commit | d472e47b6cb59a7cc214cc50db222eb86ddcf748 (patch) | |
tree | 122290eeb2d5d60026f98df524d85875096cd322 | |
parent | eb702350f7ac9c8910755fba44a98bc9a09beb4f (diff) | |
download | external_llvm-d472e47b6cb59a7cc214cc50db222eb86ddcf748.zip external_llvm-d472e47b6cb59a7cc214cc50db222eb86ddcf748.tar.gz external_llvm-d472e47b6cb59a7cc214cc50db222eb86ddcf748.tar.bz2 |
* Eliminate the Provided set. All Passes now finally just automatically
provide themselves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3125 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/CallGraph.h | 1 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure.h | 3 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DataStructure.h | 3 | ||||
-rw-r--r-- | include/llvm/Analysis/Dominators.h | 7 | ||||
-rw-r--r-- | include/llvm/Analysis/FindUnsafePointerTypes.h | 1 | ||||
-rw-r--r-- | include/llvm/Analysis/FindUsedTypes.h | 1 | ||||
-rw-r--r-- | include/llvm/Analysis/IntervalPartition.h | 1 | ||||
-rw-r--r-- | include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h | 1 | ||||
-rw-r--r-- | lib/VMCore/PassManagerT.h | 35 |
9 files changed, 16 insertions, 37 deletions
diff --git a/include/llvm/Analysis/CallGraph.h b/include/llvm/Analysis/CallGraph.h index 3305c85..4d24be3 100644 --- a/include/llvm/Analysis/CallGraph.h +++ b/include/llvm/Analysis/CallGraph.h @@ -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. diff --git a/include/llvm/Analysis/DataStructure.h b/include/llvm/Analysis/DataStructure.h index dda0adb..a320cf8 100644 --- a/include/llvm/Analysis/DataStructure.h +++ b/include/llvm/Analysis/DataStructure.h @@ -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: diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h index dda0adb..a320cf8 100644 --- a/include/llvm/Analysis/DataStructure/DataStructure.h +++ b/include/llvm/Analysis/DataStructure/DataStructure.h @@ -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: diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h index 8c9df64..2beb4ba 100644 --- a/include/llvm/Analysis/Dominators.h +++ b/include/llvm/Analysis/Dominators.h @@ -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, diff --git a/include/llvm/Analysis/FindUnsafePointerTypes.h b/include/llvm/Analysis/FindUnsafePointerTypes.h index 59fc78e..44c18cb 100644 --- a/include/llvm/Analysis/FindUnsafePointerTypes.h +++ b/include/llvm/Analysis/FindUnsafePointerTypes.h @@ -47,7 +47,6 @@ public: // virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addProvided(ID); } }; diff --git a/include/llvm/Analysis/FindUsedTypes.h b/include/llvm/Analysis/FindUsedTypes.h index 2f3e81c..000e4b7 100644 --- a/include/llvm/Analysis/FindUsedTypes.h +++ b/include/llvm/Analysis/FindUsedTypes.h @@ -46,7 +46,6 @@ public: // virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addProvided(ID); } }; diff --git a/include/llvm/Analysis/IntervalPartition.h b/include/llvm/Analysis/IntervalPartition.h index 4fd388e..a295ce1 100644 --- a/include/llvm/Analysis/IntervalPartition.h +++ b/include/llvm/Analysis/IntervalPartition.h @@ -73,7 +73,6 @@ public: // getAnalysisUsage - Implement the Pass API virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); - AU.addProvided(ID); } private: diff --git a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h index 719c05e..4035dca 100644 --- a/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h +++ b/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h @@ -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() { diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h index 46aefb7..6e5fcbd 100644 --- a/lib/VMCore/PassManagerT.h +++ b/lib/VMCore/PassManagerT.h @@ -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); } |