summaryrefslogtreecommitdiff
path: root/lib/Passes/PassBuilder.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-06-03 23:18:29 +0000
committerDavide Italiano <davide@freebsd.org>2017-06-03 23:18:29 +0000
commit653044e2ac52030fb912cc4510e0e83ab135573b (patch)
tree573b78c8191e0009cc14f695a135d7c4078f78ad /lib/Passes/PassBuilder.cpp
parent61a5551f882e6f373b91e5ebdf0b63ef28d90d24 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Passes/PassBuilder.cpp')
-rw-r--r--lib/Passes/PassBuilder.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Passes/PassBuilder.cpp b/lib/Passes/PassBuilder.cpp
index 17c60348633..1f638e76830 100644
--- a/lib/Passes/PassBuilder.cpp
+++ b/lib/Passes/PassBuilder.cpp
@@ -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::buildFunctionSimplificationPipeline(OptimizationLevel Level,
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());