summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlina Sbirlea <asbirlea@google.com>2016-07-22 22:02:19 +0000
committerAlina Sbirlea <asbirlea@google.com>2016-07-22 22:02:19 +0000
commitba21ffebff540841da6c8847fcecd82ae734038d (patch)
treef72bcc8cc0563b4962caae2eff1ce2ad163d780c
parent6118ce1221a8a4b6000289ba09efc413871304fc (diff)
downloadbcm5719-llvm-ba21ffebff540841da6c8847fcecd82ae734038d.tar.gz
bcm5719-llvm-ba21ffebff540841da6c8847fcecd82ae734038d.zip
Add flag to PassManagerBuilder to disable GVN Hoist Pass.
Summary: Adding a flag to diable GVN Hoisting by default. Note: The GVN Hoist Pass causes some Halide tests to hang. Halide will disable the pass while investigating. Reviewers: llvm-commits, chandlerc, spop, dberlin Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D22639 llvm-svn: 276479
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp7
-rw-r--r--llvm/test/Feature/optnone-opt.ll1
2 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index e921f865648..5e93bb65609 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -134,6 +134,10 @@ static cl::opt<int> PreInlineThreshold(
cl::desc("Control the amount of inlining in pre-instrumentation inliner "
"(default = 75)"));
+static cl::opt<bool> EnableGVNHoist(
+ "enable-gvn-hoist", cl::init(false), cl::Hidden,
+ cl::desc("Enable the experimental GVN Hoisting pass"));
+
PassManagerBuilder::PassManagerBuilder() {
OptLevel = 2;
SizeLevel = 0;
@@ -232,7 +236,8 @@ void PassManagerBuilder::populateFunctionPassManager(
FPM.add(createCFGSimplificationPass());
FPM.add(createSROAPass());
FPM.add(createEarlyCSEPass());
- FPM.add(createGVNHoistPass());
+ if(EnableGVNHoist)
+ FPM.add(createGVNHoistPass());
FPM.add(createLowerExpectIntrinsicPass());
}
diff --git a/llvm/test/Feature/optnone-opt.ll b/llvm/test/Feature/optnone-opt.ll
index bf26a3c322e..a17f97785f0 100644
--- a/llvm/test/Feature/optnone-opt.ll
+++ b/llvm/test/Feature/optnone-opt.ll
@@ -41,7 +41,6 @@ attributes #0 = { optnone noinline }
; OPT-O1-DAG: Skipping pass 'Combine redundant instructions'
; OPT-O1-DAG: Skipping pass 'Dead Store Elimination'
; OPT-O1-DAG: Skipping pass 'Early CSE'
-; OPT-O1-DAG: Skipping pass 'Early GVN Hoisting of Expressions'
; OPT-O1-DAG: Skipping pass 'Jump Threading'
; OPT-O1-DAG: Skipping pass 'MemCpy Optimization'
; OPT-O1-DAG: Skipping pass 'Reassociate expressions'
OpenPOWER on IntegriCloud