diff options
| author | Owen Anderson <resistor@mac.com> | 2010-10-12 19:48:12 +0000 |
|---|---|---|
| committer | Owen Anderson <resistor@mac.com> | 2010-10-12 19:48:12 +0000 |
| commit | 8ac477ffb509943c940ce37f45b8429388dfdf58 (patch) | |
| tree | 5a2e58c26e0101534213aaf595a9ee348ee8b63f /llvm/lib/Analysis | |
| parent | 604e142844b7eee7d995e04b9042904b3849d571 (diff) | |
| download | bcm5719-llvm-8ac477ffb509943c940ce37f45b8429388dfdf58.tar.gz bcm5719-llvm-8ac477ffb509943c940ce37f45b8429388dfdf58.zip | |
Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client. For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve. I hope to be able to relax
the latter requirement in the future.
llvm-svn: 116334
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/AliasAnalysisEvaluator.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Analysis/AliasSetTracker.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Analysis/IPA/GlobalsModRef.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Analysis/IVUsers.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Analysis/Lint.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/Analysis/LiveValues.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Analysis/LoopDependenceAnalysis.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Analysis/LoopInfo.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Analysis/MemDepPrinter.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Analysis/PostDominators.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Analysis/ProfileEstimatorPass.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Analysis/ProfileVerifierPass.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/Analysis/RegionInfo.cpp | 7 | ||||
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp | 5 |
16 files changed, 75 insertions, 17 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp index 77709ab9f96..1bb1d0d6589 100644 --- a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp +++ b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp @@ -74,7 +74,10 @@ namespace { } char AAEval::ID = 0; -INITIALIZE_PASS(AAEval, "aa-eval", +INITIALIZE_PASS_BEGIN(AAEval, "aa-eval", + "Exhaustive Alias Analysis Precision Evaluator", false, true) +INITIALIZE_AG_DEPENDENCY(AliasAnalysis) +INITIALIZE_PASS_END(AAEval, "aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true) FunctionPass *llvm::createAAEvalPass() { return new AAEval(); } diff --git a/llvm/lib/Analysis/AliasSetTracker.cpp b/llvm/lib/Analysis/AliasSetTracker.cpp index d3391faf82f..68525f256e5 100644 --- a/llvm/lib/Analysis/AliasSetTracker.cpp +++ b/llvm/lib/Analysis/AliasSetTracker.cpp @@ -607,5 +607,8 @@ namespace { } char AliasSetPrinter::ID = 0; -INITIALIZE_PASS(AliasSetPrinter, "print-alias-sets", +INITIALIZE_PASS_BEGIN(AliasSetPrinter, "print-alias-sets", + "Alias Set Printer", false, true) +INITIALIZE_AG_DEPENDENCY(AliasAnalysis) +INITIALIZE_PASS_END(AliasSetPrinter, "print-alias-sets", "Alias Set Printer", false, true) diff --git a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp index fc2f3dfe4fe..1319e6142af 100644 --- a/llvm/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/llvm/lib/Analysis/IPA/GlobalsModRef.cpp @@ -176,7 +176,11 @@ namespace { } char GlobalsModRef::ID = 0; -INITIALIZE_AG_PASS(GlobalsModRef, AliasAnalysis, +INITIALIZE_AG_PASS_BEGIN(GlobalsModRef, AliasAnalysis, + "globalsmodref-aa", "Simple mod/ref analysis for globals", + false, true, false) +INITIALIZE_AG_DEPENDENCY(CallGraph) +INITIALIZE_AG_PASS_END(GlobalsModRef, AliasAnalysis, "globalsmodref-aa", "Simple mod/ref analysis for globals", false, true, false) diff --git a/llvm/lib/Analysis/IVUsers.cpp b/llvm/lib/Analysis/IVUsers.cpp index e922ea2a1c1..3fc3b71ebbb 100644 --- a/llvm/lib/Analysis/IVUsers.cpp +++ b/llvm/lib/Analysis/IVUsers.cpp @@ -28,7 +28,13 @@ using namespace llvm; char IVUsers::ID = 0; -INITIALIZE_PASS(IVUsers, "iv-users", "Induction Variable Users", false, true) +INITIALIZE_PASS_BEGIN(IVUsers, "iv-users", + "Induction Variable Users", false, true) +INITIALIZE_PASS_DEPENDENCY(LoopInfo) +INITIALIZE_PASS_DEPENDENCY(DominatorTree) +INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) +INITIALIZE_PASS_END(IVUsers, "iv-users", + "Induction Variable Users", false, true) Pass *llvm::createIVUsersPass() { return new IVUsers(); diff --git a/llvm/lib/Analysis/Lint.cpp b/llvm/lib/Analysis/Lint.cpp index 918a0a9c902..f7be3298522 100644 --- a/llvm/lib/Analysis/Lint.cpp +++ b/llvm/lib/Analysis/Lint.cpp @@ -145,7 +145,12 @@ namespace { } char Lint::ID = 0; -INITIALIZE_PASS(Lint, "lint", "Statically lint-checks LLVM IR", false, true) +INITIALIZE_PASS_BEGIN(Lint, "lint", "Statically lint-checks LLVM IR", + false, true) +INITIALIZE_PASS_DEPENDENCY(DominatorTree) +INITIALIZE_AG_DEPENDENCY(AliasAnalysis) +INITIALIZE_PASS_END(Lint, "lint", "Statically lint-checks LLVM IR", + false, true) // Assert - We know that cond should be true, if not print an error message. #define Assert(C, M) \ diff --git a/llvm/lib/Analysis/LiveValues.cpp b/llvm/lib/Analysis/LiveValues.cpp index 3feaf64bdff..b71ac0de661 100644 --- a/llvm/lib/Analysis/LiveValues.cpp +++ b/llvm/lib/Analysis/LiveValues.cpp @@ -22,7 +22,11 @@ namespace llvm { } char LiveValues::ID = 0; -INITIALIZE_PASS(LiveValues, "live-values", +INITIALIZE_PASS_BEGIN(LiveValues, "live-values", + "Value Liveness Analysis", false, true) +INITIALIZE_PASS_DEPENDENCY(DominatorTree) +INITIALIZE_PASS_DEPENDENCY(LoopInfo) +INITIALIZE_PASS_END(LiveValues, "live-values", "Value Liveness Analysis", false, true) LiveValues::LiveValues() : FunctionPass(ID) {} diff --git a/llvm/lib/Analysis/LoopDependenceAnalysis.cpp b/llvm/lib/Analysis/LoopDependenceAnalysis.cpp index aacdd29a838..068b434a07f 100644 --- a/llvm/lib/Analysis/LoopDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/LoopDependenceAnalysis.cpp @@ -46,7 +46,11 @@ LoopPass *llvm::createLoopDependenceAnalysisPass() { return new LoopDependenceAnalysis(); } -INITIALIZE_PASS(LoopDependenceAnalysis, "lda", +INITIALIZE_PASS_BEGIN(LoopDependenceAnalysis, "lda", + "Loop Dependence Analysis", false, true) +INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) +INITIALIZE_AG_DEPENDENCY(AliasAnalysis) +INITIALIZE_PASS_END(LoopDependenceAnalysis, "lda", "Loop Dependence Analysis", false, true) char LoopDependenceAnalysis::ID = 0; diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp index 8398c95c727..447c8a6ee4e 100644 --- a/llvm/lib/Analysis/LoopInfo.cpp +++ b/llvm/lib/Analysis/LoopInfo.cpp @@ -38,7 +38,9 @@ VerifyLoopInfoX("verify-loop-info", cl::location(VerifyLoopInfo), cl::desc("Verify loop info (time consuming)")); char LoopInfo::ID = 0; -INITIALIZE_PASS(LoopInfo, "loops", "Natural Loop Information", true, true) +INITIALIZE_PASS_BEGIN(LoopInfo, "loops", "Natural Loop Information", true, true) +INITIALIZE_PASS_DEPENDENCY(DominatorTree) +INITIALIZE_PASS_END(LoopInfo, "loops", "Natural Loop Information", true, true) //===----------------------------------------------------------------------===// // Loop implementation diff --git a/llvm/lib/Analysis/MemDepPrinter.cpp b/llvm/lib/Analysis/MemDepPrinter.cpp index 1f5a2d1ef3b..e003cd8074d 100644 --- a/llvm/lib/Analysis/MemDepPrinter.cpp +++ b/llvm/lib/Analysis/MemDepPrinter.cpp @@ -50,8 +50,11 @@ namespace { } char MemDepPrinter::ID = 0; -INITIALIZE_PASS(MemDepPrinter, "print-memdeps", "Print MemDeps of function", - false, true) +INITIALIZE_PASS_BEGIN(MemDepPrinter, "print-memdeps", + "Print MemDeps of function", false, true) +INITIALIZE_PASS_DEPENDENCY(MemoryDependenceAnalysis) +INITIALIZE_PASS_END(MemDepPrinter, "print-memdeps", + "Print MemDeps of function", false, true) FunctionPass *llvm::createMemDepPrinter() { return new MemDepPrinter(); diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index 1708fe85ba3..a51c5285510 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -47,8 +47,11 @@ STATISTIC(NumCacheCompleteNonLocalPtr, char MemoryDependenceAnalysis::ID = 0; // Register this pass... -INITIALIZE_PASS(MemoryDependenceAnalysis, "memdep", +INITIALIZE_PASS_BEGIN(MemoryDependenceAnalysis, "memdep", "Memory Dependence Analysis", false, true) +INITIALIZE_AG_DEPENDENCY(AliasAnalysis) +INITIALIZE_PASS_END(MemoryDependenceAnalysis, "memdep", + "Memory Dependence Analysis", false, true) MemoryDependenceAnalysis::MemoryDependenceAnalysis() : FunctionPass(ID), PredCache(0) { diff --git a/llvm/lib/Analysis/PostDominators.cpp b/llvm/lib/Analysis/PostDominators.cpp index c745791c8d6..e648822579a 100644 --- a/llvm/lib/Analysis/PostDominators.cpp +++ b/llvm/lib/Analysis/PostDominators.cpp @@ -53,7 +53,10 @@ FunctionPass* llvm::createPostDomTree() { // PostDominanceFrontier Implementation //===----------------------------------------------------------------------===// -INITIALIZE_PASS(PostDominanceFrontier, "postdomfrontier", +INITIALIZE_PASS_BEGIN(PostDominanceFrontier, "postdomfrontier", + "Post-Dominance Frontier Construction", true, true) +INITIALIZE_PASS_DEPENDENCY(PostDominatorTree) +INITIALIZE_PASS_END(PostDominanceFrontier, "postdomfrontier", "Post-Dominance Frontier Construction", true, true) const DominanceFrontier::DomSetType & diff --git a/llvm/lib/Analysis/ProfileEstimatorPass.cpp b/llvm/lib/Analysis/ProfileEstimatorPass.cpp index 06e2af470ed..e3aad60b959 100644 --- a/llvm/lib/Analysis/ProfileEstimatorPass.cpp +++ b/llvm/lib/Analysis/ProfileEstimatorPass.cpp @@ -72,7 +72,10 @@ namespace { } // End of anonymous namespace char ProfileEstimatorPass::ID = 0; -INITIALIZE_AG_PASS(ProfileEstimatorPass, ProfileInfo, "profile-estimator", +INITIALIZE_AG_PASS_BEGIN(ProfileEstimatorPass, ProfileInfo, "profile-estimator", + "Estimate profiling information", false, true, false) +INITIALIZE_PASS_DEPENDENCY(LoopInfo) +INITIALIZE_AG_PASS_END(ProfileEstimatorPass, ProfileInfo, "profile-estimator", "Estimate profiling information", false, true, false) namespace llvm { diff --git a/llvm/lib/Analysis/ProfileVerifierPass.cpp b/llvm/lib/Analysis/ProfileVerifierPass.cpp index 41fdb276776..f0fa05a29f7 100644 --- a/llvm/lib/Analysis/ProfileVerifierPass.cpp +++ b/llvm/lib/Analysis/ProfileVerifierPass.cpp @@ -366,7 +366,10 @@ namespace llvm { char ProfileVerifierPassT<FType, BType>::ID = 0; } -INITIALIZE_PASS(ProfileVerifierPass, "profile-verifier", +INITIALIZE_PASS_BEGIN(ProfileVerifierPass, "profile-verifier", + "Verify profiling information", false, true) +INITIALIZE_AG_DEPENDENCY(ProfileInfo) +INITIALIZE_PASS_END(ProfileVerifierPass, "profile-verifier", "Verify profiling information", false, true) namespace llvm { diff --git a/llvm/lib/Analysis/RegionInfo.cpp b/llvm/lib/Analysis/RegionInfo.cpp index a2643e09854..95b78cd443d 100644 --- a/llvm/lib/Analysis/RegionInfo.cpp +++ b/llvm/lib/Analysis/RegionInfo.cpp @@ -734,7 +734,12 @@ RegionInfo::getCommonRegion(SmallVectorImpl<BasicBlock*> &BBs) const { } char RegionInfo::ID = 0; -INITIALIZE_PASS(RegionInfo, "regions", +INITIALIZE_PASS_BEGIN(RegionInfo, "regions", + "Detect single entry single exit regions", true, true) +INITIALIZE_PASS_DEPENDENCY(DominatorTree) +INITIALIZE_PASS_DEPENDENCY(PostDominatorTree) +INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) +INITIALIZE_PASS_END(RegionInfo, "regions", "Detect single entry single exit regions", true, true) // Create methods available outside of this file, to use them diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 8bd4da65110..83f7a44a477 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -103,7 +103,11 @@ MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden, "derived loop"), cl::init(100)); -INITIALIZE_PASS(ScalarEvolution, "scalar-evolution", +INITIALIZE_PASS_BEGIN(ScalarEvolution, "scalar-evolution", + "Scalar Evolution Analysis", false, true) +INITIALIZE_PASS_DEPENDENCY(LoopInfo) +INITIALIZE_PASS_DEPENDENCY(DominatorTree) +INITIALIZE_PASS_END(ScalarEvolution, "scalar-evolution", "Scalar Evolution Analysis", false, true) char ScalarEvolution::ID = 0; diff --git a/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp b/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp index dcfe2849841..f009328854b 100644 --- a/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp @@ -57,8 +57,11 @@ namespace { // Register this pass... char ScalarEvolutionAliasAnalysis::ID = 0; -INITIALIZE_AG_PASS(ScalarEvolutionAliasAnalysis, AliasAnalysis, "scev-aa", +INITIALIZE_AG_PASS_BEGIN(ScalarEvolutionAliasAnalysis, AliasAnalysis, "scev-aa", "ScalarEvolution-based Alias Analysis", false, true, false) +INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) +INITIALIZE_AG_PASS_END(ScalarEvolutionAliasAnalysis, AliasAnalysis, "scev-aa", + "ScalarEvolution-based Alias Analysis", false, true, false) FunctionPass *llvm::createScalarEvolutionAliasAnalysisPass() { return new ScalarEvolutionAliasAnalysis(); |

