[PATCH] D61030: [PassManagerBuilder] Add option for interleaved loops, for loop vectorize.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 10:30:21 PDT 2019


asbirlea created this revision.
asbirlea added a reviewer: chandlerc.
Herald added subscribers: dmgreen, jlebar, mehdi_amini.
Herald added a project: LLVM.

Match NewPassManager behavior: add option for interleaved loops in the
old pass manager, and use that instead of the flag used to disable loop unroll.
No changes in the defaults.


Repository:
  rL LLVM

https://reviews.llvm.org/D61030

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
@@ -162,9 +162,7 @@
     DisableUnrollLoops = false;
     SLPVectorize = RunSLPVectorization;
     LoopVectorize = EnableLoopVectorization;
-    // FIXME: Add: LoopsInterleaved = EnableLoopInterleaving;
-    // Replace usage of DisableUnrollLoops with LoopsInterleaved when creating
-    // the LoopVectorize pass, to be consistent with the new pass manager.
+    LoopsInterleaved = EnableLoopInterleaving;
     RerollLoops = RunLoopRerolling;
     NewGVN = RunNewGVN;
     LicmMssaOptCap = SetLicmMssaOptCap;
@@ -673,7 +671,7 @@
   // llvm.loop.distribute=true or when -enable-loop-distribute is specified.
   MPM.add(createLoopDistributePass());
 
-  MPM.add(createLoopVectorizePass(DisableUnrollLoops, !LoopVectorize));
+  MPM.add(createLoopVectorizePass(!LoopsInterleaved, !LoopVectorize));
 
   // Eliminate loads by forwarding stores from the previous iteration to loads
   // of the current iteration.
Index: include/llvm/Transforms/IPO/PassManagerBuilder.h
===================================================================
--- include/llvm/Transforms/IPO/PassManagerBuilder.h
+++ include/llvm/Transforms/IPO/PassManagerBuilder.h
@@ -145,6 +145,7 @@
   bool DisableUnrollLoops;
   bool SLPVectorize;
   bool LoopVectorize;
+  bool LoopsInterleaved;
   bool RerollLoops;
   bool NewGVN;
   bool DisableGVNLoadPRE;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61030.196278.patch
Type: text/x-patch
Size: 1531 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190423/e6dae44d/attachment.bin>


More information about the llvm-commits mailing list