summaryrefslogtreecommitdiffstats
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
commit8a09b8eba9adb8360d42121becf7d15ef7531624 (patch)
tree35fc3021c42534298bcac50c1d75c5cccbb2b7d2
parent6fa60f5e8b22c2c3d4b32d17847233d785b23bef (diff)
downloadbcm5719-llvm-8a09b8eba9adb8360d42121becf7d15ef7531624.tar.gz
bcm5719-llvm-8a09b8eba9adb8360d42121becf7d15ef7531624.zip
[NewPM] Add a temporary cl::opt() to test NewGVN.
llvm-svn: 303586
-rw-r--r--llvm/lib/Passes/PassBuilder.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index 6ece7965ce6..7be464e52b6 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud