summaryrefslogtreecommitdiffstats
path: root/lib/Passes
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2017-02-12 05:34:04 +0000
committerChandler Carruth <chandlerc@gmail.com>2017-02-12 05:34:04 +0000
commit9c2410924c0f9bc09c9f79a342aaa531d9be6eb4 (patch)
tree41bc217965a43162d30191ab067e43280dddb663 /lib/Passes
parent820dc664db7fe84669b76c50962b278e5ed19992 (diff)
[PM] Enable GlobalsAA in the new PM's pipeline by default.
All the invalidation issues and bugs in this seem to be fixed, it has survived a full build of the test suite plus SPEC with asserts and ASan enabled on the Clang binary used. Differential Revision: https://reviews.llvm.org/D29815 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Passes')
-rw-r--r--lib/Passes/PassBuilder.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/Passes/PassBuilder.cpp b/lib/Passes/PassBuilder.cpp
index 06190682f32c..9264cf11e504 100644
--- a/lib/Passes/PassBuilder.cpp
+++ b/lib/Passes/PassBuilder.cpp
@@ -431,10 +431,9 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
GlobalCleanupPM.addPass(SimplifyCFGPass());
MPM.addPass(createModuleToFunctionPassAdaptor(std::move(GlobalCleanupPM)));
- // FIXME: Enable this when cross-IR-unit analysis invalidation is working.
-#if 0
- MPM.addPass(RequireAnalysisPass<GlobalsAA>());
-#endif
+ // Require the GlobalsAA analysis for the module so we can query it within
+ // the CGSCC pipeline.
+ MPM.addPass(RequireAnalysisPass<GlobalsAA, Module>());
// Now begin the main postorder CGSCC pipeline.
// FIXME: The current CGSCC pipeline has its origins in the legacy pass
@@ -482,17 +481,14 @@ PassBuilder::buildPerModuleDefaultPipeline(OptimizationLevel Level,
// FIXME: Is this really an optimization rather than a canonicalization?
MPM.addPass(ReversePostOrderFunctionAttrsPass());
- // Recompute GloblasAA here prior to function passes. This is particularly
+ // Re-require GloblasAA here prior to function passes. This is particularly
// useful as the above will have inlined, DCE'ed, and function-attr
// propagated everything. We should at this point have a reasonably minimal
// and richly annotated call graph. By computing aliasing and mod/ref
// information for all local globals here, the late loop passes and notably
// the vectorizer will be able to use them to help recognize vectorizable
// memory operations.
- // FIXME: Enable this once analysis invalidation is fully supported.
-#if 0
- MPM.addPass(Require<GlobalsAA>());
-#endif
+ MPM.addPass(RequireAnalysisPass<GlobalsAA, Module>());
FunctionPassManager OptimizePM(DebugLogging);
OptimizePM.addPass(Float2IntPass());
@@ -766,12 +762,8 @@ AAManager PassBuilder::buildDefaultAAPipeline() {
// Add support for querying global aliasing information when available.
// Because the `AAManager` is a function analysis and `GlobalsAA` is a module
// analysis, all that the `AAManager` can do is query for any *cached*
- // results from `GlobalsAA` through a readonly proxy..
-#if 0
- // FIXME: Enable once the invalidation logic supports this. Currently, the
- // `AAManager` will hold stale references to the module analyses.
+ // results from `GlobalsAA` through a readonly proxy.
AA.registerModuleAnalysis<GlobalsAA>();
-#endif
return AA;
}