[llvm] r304671 - [PM] Add GVNSink to the pipeline.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 3 16:18:30 PDT 2017
Author: davide
Date: Sat Jun 3 18:18:29 2017
New Revision: 304671
URL: http://llvm.org/viewvc/llvm-project?rev=304671&view=rev
Log:
[PM] Add GVNSink to the pipeline.
With this, the two pipelines should be in sync again (modulo
LoopUnswitch, but Chandler is actively working on that).
Differential Revision: https://reviews.llvm.org/D33810
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=304671&r1=304670&r2=304671&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Sat Jun 3 18:18:29 2017
@@ -164,6 +164,10 @@ 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)"));
+static cl::opt<bool> EnableGVNSink(
+ "enable-npm-gvn-sink", cl::init(false), cl::Hidden,
+ cl::desc("Enable the GVN hoisting pass for the new PM (default = off)"));
+
static Regex DefaultAliasRegex(
"^(default|thinlto-pre-link|thinlto|lto-pre-link|lto)<(O[0123sz])>$");
@@ -314,6 +318,12 @@ PassBuilder::buildFunctionSimplification
if (EnableGVNHoist)
FPM.addPass(GVNHoistPass());
+ // Global value numbering based sinking.
+ if (EnableGVNSink) {
+ FPM.addPass(GVNSinkPass());
+ FPM.addPass(SimplifyCFGPass());
+ }
+
// Speculative execution if the target has divergent branches; otherwise nop.
FPM.addPass(SpeculativeExecutionPass());
More information about the llvm-commits
mailing list