summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2016-11-28 10:42:21 +0000
committerChandler Carruth <chandlerc@gmail.com>2016-11-28 10:42:21 +0000
commit0c6efff178103f5b2bdeb6d20e5468027b02c13e (patch)
treed4673ff4a457097216db0932961e43b746f42ff7 /llvm/lib
parent1642c5d8713a73da1865f320d3bad103f6274b76 (diff)
downloadbcm5719-llvm-0c6efff178103f5b2bdeb6d20e5468027b02c13e.tar.gz
bcm5719-llvm-0c6efff178103f5b2bdeb6d20e5468027b02c13e.zip
[PM] Remove weird marking of invalidated analyses as "preserved".
This never made a lot of sense. They've been invalidated for one IR unit but they aren't really preserved in any normal sense. It seemed like it would be an elegant way of communicating to outer IR units that pass managers and adaptors had already handled invalidation, but we've since ended up adding sets that model this more clearly: we're now using the 'AllAnalysesOn<IRUnitT>' set to handle cases where the trick of "preserving" invalidated analyses didn't work. This patch moves to rely on that technique exclusively and removes the cumbersome API aspect of updating the preserved set when doing invalidation. This in turn will simplify a *number* of upcoming patches. This has a side benefit of exposing a number of places where we were failing to mark the 'AllAnalysesOn<IRUnitT>' set as preserved. This patch fixes those, and with those fixes shouldn't change any observable behavior. llvm-svn: 288023
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/CGSCCPassManager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/CGSCCPassManager.cpp b/llvm/lib/Analysis/CGSCCPassManager.cpp
index 2b1591cfbcf..63715806c04 100644
--- a/llvm/lib/Analysis/CGSCCPassManager.cpp
+++ b/llvm/lib/Analysis/CGSCCPassManager.cpp
@@ -56,10 +56,8 @@ PassManager<LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &,
assert(C->begin() != C->end() && "Cannot have an empty SCC!");
// Update the analysis manager 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.
- PassPA = AM.invalidate(*C, std::move(PassPA));
+ // invalidates analyses.
+ AM.invalidate(*C, PassPA);
// Finally, we intersect the final preserved analyses to compute the
// aggregate preserved set for this pass manager.
@@ -72,6 +70,12 @@ PassManager<LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &,
// ...getContext().yield();
}
+ // Invaliadtion was handled after each pass in the above loop for the current
+ // SCC. Therefore, the remaining analysis results in the AnalysisManager are
+ // preserved. We mark this with a set so that we don't need to inspect each
+ // one individually.
+ PA.preserve<AllAnalysesOn<LazyCallGraph::SCC>>();
+
if (DebugLogging)
dbgs() << "Finished CGSCC pass manager run.\n";
OpenPOWER on IntegriCloud