[PATCH] D22639: Add flag to PassManagerBuilder to disable GVN Hoist Pass.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 13:46:21 PDT 2016


asbirlea updated this revision to Diff 64953.
asbirlea added a comment.

Reverting previous update.
gvn-max-hoisted can be used as a command-line flag. Keep only the PassManagerBuilder flag while the pass gains maturity.

Note that the pass is still enabled by default.


https://reviews.llvm.org/D22639

Files:
  include/llvm/Transforms/IPO/PassManagerBuilder.h
  lib/Transforms/IPO/PassManagerBuilder.cpp

Index: lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- lib/Transforms/IPO/PassManagerBuilder.cpp
+++ lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -140,6 +140,7 @@
     LibraryInfo = nullptr;
     Inliner = nullptr;
     ModuleSummary = nullptr;
+    DisableGVNHoist = false;
     DisableUnitAtATime = false;
     DisableUnrollLoops = false;
     BBVectorize = RunBBVectorization;
@@ -232,7 +233,8 @@
   FPM.add(createCFGSimplificationPass());
   FPM.add(createSROAPass());
   FPM.add(createEarlyCSEPass());
-  FPM.add(createGVNHoistPass());
+  if(!DisableGVNHoist)
+    FPM.add(createGVNHoistPass());
   FPM.add(createLowerExpectIntrinsicPass());
 }
 
Index: include/llvm/Transforms/IPO/PassManagerBuilder.h
===================================================================
--- include/llvm/Transforms/IPO/PassManagerBuilder.h
+++ include/llvm/Transforms/IPO/PassManagerBuilder.h
@@ -122,6 +122,7 @@
   /// The module summary index to use for function importing.
   const ModuleSummaryIndex *ModuleSummary;
 
+  bool DisableGVNHoist;
   bool DisableTailCalls;
   bool DisableUnitAtATime;
   bool DisableUnrollLoops;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22639.64953.patch
Type: text/x-patch
Size: 1184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160721/c1436d3d/attachment.bin>


More information about the llvm-commits mailing list