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/Transforms/Utils | |
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/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/LCSSA.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/Transforms/Utils/Mem2Reg.cpp | 9 |
3 files changed, 25 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp index 777e87619c0..193dd3895da 100644 --- a/llvm/lib/Transforms/Utils/LCSSA.cpp +++ b/llvm/lib/Transforms/Utils/LCSSA.cpp @@ -90,7 +90,13 @@ namespace { } char LCSSA::ID = 0; -INITIALIZE_PASS(LCSSA, "lcssa", "Loop-Closed SSA Form Pass", false, false) +INITIALIZE_PASS_BEGIN(LCSSA, "lcssa", "Loop-Closed SSA Form Pass", false, false) +INITIALIZE_PASS_DEPENDENCY(DominatorTree) +INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) +INITIALIZE_PASS_DEPENDENCY(LoopInfo) +INITIALIZE_PASS_DEPENDENCY(LoopSimplify) +INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) +INITIALIZE_PASS_END(LCSSA, "lcssa", "Loop-Closed SSA Form Pass", false, false) Pass *llvm::createLCSSAPass() { return new LCSSA(); } char &llvm::LCSSAID = LCSSA::ID; diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 60b70f6f928..8b47899d233 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -107,7 +107,16 @@ namespace { } char LoopSimplify::ID = 0; -INITIALIZE_PASS(LoopSimplify, "loopsimplify", +INITIALIZE_PASS_BEGIN(LoopSimplify, "loopsimplify", + "Canonicalize natural loops", true, false) +INITIALIZE_PASS_DEPENDENCY(DominatorTree) +INITIALIZE_PASS_DEPENDENCY(LoopInfo) +INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) +INITIALIZE_PASS_DEPENDENCY(BreakCriticalEdges) +INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) +INITIALIZE_PASS_DEPENDENCY(LCSSA) +INITIALIZE_AG_DEPENDENCY(AliasAnalysis) +INITIALIZE_PASS_END(LoopSimplify, "loopsimplify", "Canonicalize natural loops", true, false) // Publically exposed interface to pass... diff --git a/llvm/lib/Transforms/Utils/Mem2Reg.cpp b/llvm/lib/Transforms/Utils/Mem2Reg.cpp index c61ffef6d27..588a1654f90 100644 --- a/llvm/lib/Transforms/Utils/Mem2Reg.cpp +++ b/llvm/lib/Transforms/Utils/Mem2Reg.cpp @@ -49,7 +49,14 @@ namespace { } // end of anonymous namespace char PromotePass::ID = 0; -INITIALIZE_PASS(PromotePass, "mem2reg", "Promote Memory to Register", +INITIALIZE_PASS_BEGIN(PromotePass, "mem2reg", "Promote Memory to Register", + false, false) +INITIALIZE_PASS_DEPENDENCY(DominatorTree) +INITIALIZE_PASS_DEPENDENCY(DominanceFrontier) +INITIALIZE_PASS_DEPENDENCY(UnifyFunctionExitNodes) +INITIALIZE_PASS_DEPENDENCY(LowerSwitch) +INITIALIZE_PASS_DEPENDENCY(LowerInvoke) +INITIALIZE_PASS_END(PromotePass, "mem2reg", "Promote Memory to Register", false, false) bool PromotePass::runOnFunction(Function &F) { |