]> granicus.if.org Git - llvm/commitdiff
Merging r276479:
authorHans Wennborg <hans@hanshq.net>
Mon, 25 Jul 2016 16:37:31 +0000 (16:37 +0000)
committerHans Wennborg <hans@hanshq.net>
Mon, 25 Jul 2016 16:37:31 +0000 (16:37 +0000)
------------------------------------------------------------------------
r276479 | asbirlea | 2016-07-22 15:02:19 -0700 (Fri, 22 Jul 2016) | 11 lines

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
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276647 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/PassManagerBuilder.cpp

index cf5b76dc365be4f81ef879e596a472961589ffd3..df6a48e05d42d1311631d2f46a4736836b4c1e5f 100644 (file)
@@ -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());
 }