summaryrefslogtreecommitdiff
path: root/lib/Passes
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-05-22 23:41:40 +0000
committerDavide Italiano <davide@freebsd.org>2017-05-22 23:41:40 +0000
commitefb6b106477971aea02e5f5a169e2961fa8695a3 (patch)
treea4b4f7f233dd037dc67001df2c64c7c8b13ab207 /lib/Passes
parent21282be93c350d881071009035b890a8f615634f (diff)
[NewPM] Add a temporary cl::opt() to test NewGVN.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Passes')
-rw-r--r--lib/Passes/PassBuilder.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Passes/PassBuilder.cpp b/lib/Passes/PassBuilder.cpp
index 6ece7965ce6..7be464e52b6 100644
--- a/lib/Passes/PassBuilder.cpp
+++ b/lib/Passes/PassBuilder.cpp
@@ -155,6 +155,11 @@ static cl::opt<bool>
cl::Hidden, cl::ZeroOrMore,
cl::desc("Run Partial inlinining pass"));
+static cl::opt<bool>
+ RunNewGVN("enable-nmp-newgvn", cl::init(false),
+ cl::Hidden, cl::ZeroOrMore,
+ cl::desc("Run NewGVN instead of GVN"));
+
static cl::opt<bool> EnableGVNHoist(
"enable-npm-gvn-hoist", cl::init(false), cl::Hidden,
cl::desc("Enable the GVN hoisting pass for the new PM (default = off)"));
@@ -357,7 +362,10 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
if (Level != O1) {
// These passes add substantial compile time so skip them at O1.
FPM.addPass(MergedLoadStoreMotionPass());
- FPM.addPass(GVN());
+ if (RunNewGVN)
+ FPM.addPass(NewGVNPass());
+ else
+ FPM.addPass(GVN());
}
// Specially optimize memory movement as it doesn't look like dataflow in SSA.
@@ -774,7 +782,10 @@ ModulePassManager PassBuilder::buildLTODefaultPipeline(OptimizationLevel Level,
// FIXME: once we fix LoopPass Manager, add LICM here.
// FIXME: once we provide support for enabling MLSM, add it here.
// FIXME: once we provide support for enabling NewGVN, add it here.
- MainFPM.addPass(GVN());
+ if (RunNewGVN)
+ MainFPM.addPass(NewGVNPass());
+ else
+ MainFPM.addPass(GVN());
// Remove dead memcpy()'s.
MainFPM.addPass(MemCpyOptPass());