summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-07-22 11:57:28 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-07-22 11:57:28 +0000
commite9ea5a66f2d0a0dd1795d41a2885cadb359de973 (patch)
treec958674e19203d48e1f798557f487678ec7c0b4b
parent55dd48c3638db3e2b32e786b6e183b775c38f0f7 (diff)
downloadbcm5719-llvm-e9ea5a66f2d0a0dd1795d41a2885cadb359de973.tar.gz
bcm5719-llvm-e9ea5a66f2d0a0dd1795d41a2885cadb359de973.zip
[GMR] Add a flag to enable GlobalsModRef in the normal compilation
pipeline. Even before I started improving its runtime, it was already crazy fast once the call graph exists, and if we can get it to be conservatively correct, will still likely catch a lot of interesting and useful cases. So it may well be useful to enable by default. But more importantly for me, this should make it easier for me to test that changes aren't breaking it in fundamental ways by enabling it for normal builds. llvm-svn: 242895
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index 4e290a2db82..cf16aaacb0d 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -89,6 +89,11 @@ static cl::opt<bool> EnableLoopDistribute(
"enable-loop-distribute", cl::init(false), cl::Hidden,
cl::desc("Enable the new, experimental LoopDistribution Pass"));
+static cl::opt<bool> EnableNonLTOGlobalsModRef(
+ "enable-non-lto-gmr", cl::init(false), cl::Hidden,
+ cl::desc(
+ "Enable the GlobalsModRef AliasAnalysis outside of the LTO pipeline."));
+
PassManagerBuilder::PassManagerBuilder() {
OptLevel = 2;
SizeLevel = 0;
@@ -213,6 +218,12 @@ void PassManagerBuilder::populateModulePassManager(
MPM.add(createCFGSimplificationPass()); // Clean up after IPCP & DAE
}
+ if (EnableNonLTOGlobalsModRef)
+ // We add a module alias analysis pass here. In part due to bugs in the
+ // analysis infrastructure this "works" in that the analysis stays alive
+ // for the entire SCC pass run below.
+ MPM.add(createGlobalsModRefPass());
+
// Start of CallGraph SCC passes.
if (!DisableUnitAtATime)
MPM.add(createPruneEHPass()); // Remove dead EH info
OpenPOWER on IntegriCloud