diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-01-31 00:45:11 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-01-31 00:45:11 +0000 |
| commit | d5d56780e2c813cc7fbe1667506feecfbd008bda (patch) | |
| tree | 41516e4520f896fda9de54e586c0f8c54d49cd9d /llvm/lib/Transforms/Scalar/ADCE.cpp | |
| parent | c2ef08ccf51749f039cf143c07b8ffcd2b973cdd (diff) | |
| download | bcm5719-llvm-d5d56780e2c813cc7fbe1667506feecfbd008bda.tar.gz bcm5719-llvm-d5d56780e2c813cc7fbe1667506feecfbd008bda.zip | |
Convert xforms over to new pass structure.
llvm-svn: 1605
Diffstat (limited to 'llvm/lib/Transforms/Scalar/ADCE.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/ADCE.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Scalar/ADCE.cpp b/llvm/lib/Transforms/Scalar/ADCE.cpp index 3c3ba78f5a5..5449f223462 100644 --- a/llvm/lib/Transforms/Scalar/ADCE.cpp +++ b/llvm/lib/Transforms/Scalar/ADCE.cpp @@ -42,7 +42,7 @@ public: // doADCE() - Run the Agressive Dead Code Elimination algorithm, returning // true if the method was modified. - bool doADCE(); + bool doADCE(cfg::DominanceFrontier &CDG); //===--------------------------------------------------------------------===// // The implementation of this class @@ -76,12 +76,7 @@ private: // doADCE() - Run the Agressive Dead Code Elimination algorithm, returning // true if the method was modified. // -bool ADCE::doADCE() { - // Compute the control dependence graph... Note that this has a side effect - // on the CFG: a new return bb is added and all returns are merged here. - // - cfg::DominanceFrontier CDG(cfg::DominatorSet(M, true)); - +bool ADCE::doADCE(cfg::DominanceFrontier &CDG) { #ifdef DEBUG_ADCE cerr << "Method: " << M; #endif @@ -296,8 +291,19 @@ BasicBlock *ADCE::fixupCFG(BasicBlock *BB, std::set<BasicBlock*> &VisitedBlocks, // doADCE - Execute the Agressive Dead Code Elimination Algorithm // -bool AgressiveDCE::doADCE(Method *M) { +bool AgressiveDCE::runOnMethod(Method *M) { if (M->isExternal()) return false; ADCE DCE(M); - return DCE.doADCE(); + return DCE.doADCE( + getAnalysis<cfg::DominanceFrontier>(cfg::DominanceFrontier::PostDomID)); +} + + +// getAnalysisUsageInfo - We require post dominance frontiers (aka Control +// Dependence Graph) +// +void AgressiveDCE::getAnalysisUsageInfo(Pass::AnalysisSet &Requires, + Pass::AnalysisSet &Destroyed, + Pass::AnalysisSet &Provided) { + Requires.push_back(cfg::DominanceFrontier::PostDomID); } |

