aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CGSCCPassManager.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-01-13 11:13:56 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-01-13 11:13:56 +0000
commit816702ffe00a9bf60704d1c992f55203ca39c55c (patch)
treea9435a1c60ebeb5025389cfc7f90e42913e29ead /llvm/lib/Analysis/CGSCCPassManager.cpp
parentcdcb580d4e7760b7fd2b85fd647c7e5c3478ee99 (diff)
downloadllvm-816702ffe00a9bf60704d1c992f55203ca39c55c.zip
llvm-816702ffe00a9bf60704d1c992f55203ca39c55c.tar.gz
llvm-816702ffe00a9bf60704d1c992f55203ca39c55c.tar.bz2
[PM] Refactor the new pass manager to use a single template to implement
the generic functionality of the pass managers themselves. In the new infrastructure, the pass "manager" isn't actually interesting at all. It just pipelines a single chunk of IR through N passes. We don't need to know anything about the IR or the passes to do this really and we can replace the 3 implementations of the exact same functionality with a single generic PassManager template, complementing the single generic AnalysisManager template. I've left typedefs in place to give convenient names to the various obvious instantiations of the template. With this, I think I've nuked almost all of the redundant logic in the managers, and I think the overall design is actually simpler for having single templates that clearly indicate there is no special logic here. The logging is made somewhat more annoying by this change, but I don't think the difference is worth having heavy-weight traits to help log things. llvm-svn: 225783
Diffstat (limited to 'llvm/lib/Analysis/CGSCCPassManager.cpp')
-rw-r--r--llvm/lib/Analysis/CGSCCPassManager.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/llvm/lib/Analysis/CGSCCPassManager.cpp b/llvm/lib/Analysis/CGSCCPassManager.cpp
index 7e86d66..659e37b 100644
--- a/llvm/lib/Analysis/CGSCCPassManager.cpp
+++ b/llvm/lib/Analysis/CGSCCPassManager.cpp
@@ -17,38 +17,6 @@ static cl::opt<bool>
DebugPM("debug-cgscc-pass-manager", cl::Hidden,
cl::desc("Print CGSCC pass management debugging information"));
-PreservedAnalyses CGSCCPassManager::run(LazyCallGraph::SCC &C,
- CGSCCAnalysisManager *AM) {
- PreservedAnalyses PA = PreservedAnalyses::all();
-
- if (DebugPM)
- dbgs() << "Starting CGSCC pass manager run.\n";
-
- for (unsigned Idx = 0, Size = Passes.size(); Idx != Size; ++Idx) {
- if (DebugPM)
- dbgs() << "Running CGSCC pass: " << Passes[Idx]->name() << "\n";
-
- PreservedAnalyses PassPA = Passes[Idx]->run(C, AM);
-
- // If we have an active analysis manager at this level we want to ensure we
- // update it as each pass runs and potentially invalidates analyses. We
- // also update the preserved set of analyses based on what analyses we have
- // already handled the invalidation for here and don't need to invalidate
- // when finished.
- if (AM)
- PassPA = AM->invalidate(C, std::move(PassPA));
-
- // Finally, we intersect the final preserved analyses to compute the
- // aggregate preserved set for this pass manager.
- PA.intersect(std::move(PassPA));
- }
-
- if (DebugPM)
- dbgs() << "Finished CGSCC pass manager run.\n";
-
- return PA;
-}
-
char CGSCCAnalysisManagerModuleProxy::PassID;
CGSCCAnalysisManagerModuleProxy::Result