[llvm] r303586 - [NewPM] Add a temporary cl::opt() to test NewGVN.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Mon May 22 16:41:40 PDT 2017
Author: davide
Date: Mon May 22 18:41:40 2017
New Revision: 303586
URL: http://llvm.org/viewvc/llvm-project?rev=303586&view=rev
Log:
[NewPM] Add a temporary cl::opt() to test NewGVN.
Modified:
llvm/trunk/lib/Passes/PassBuilder.cpp
Modified: llvm/trunk/lib/Passes/PassBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=303586&r1=303585&r2=303586&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Mon May 22 18:41:40 2017
@@ -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::buildFunctionSimplification
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::buildLTOD
// 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());
More information about the llvm-commits
mailing list