diff options
| author | Alina Sbirlea <asbirlea@google.com> | 2019-04-19 16:11:59 +0000 |
|---|---|---|
| committer | Alina Sbirlea <asbirlea@google.com> | 2019-04-19 16:11:59 +0000 |
| commit | 0499a2f961ab0af5bab9e96bc5f86a7a7cb35292 (patch) | |
| tree | 65c8402050bf6df1dd050d5667353fcbc35ebfb5 /llvm/lib/Transforms | |
| parent | 51873d315037a9419510662822ee2746db4b79c3 (diff) | |
| download | bcm5719-llvm-0499a2f961ab0af5bab9e96bc5f86a7a7cb35292.tar.gz bcm5719-llvm-0499a2f961ab0af5bab9e96bc5f86a7a7cb35292.zip | |
[NewPassManager] Adding pass tuning options: loop vectorize.
Summary:
Trying to add the plumbing necessary to add tuning options to the new pass manager.
Testing with the flags for loop vectorize.
Reviewers: chandlerc
Subscribers: sanjoy, mehdi_amini, jlebar, steven_wu, dexonsmith, dang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59723
llvm-svn: 358763
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index 745f663ebdc..1a12d77e54a 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -41,6 +41,7 @@ #include "llvm/Transforms/Scalar/SimpleLoopUnswitch.h" #include "llvm/Transforms/Utils.h" #include "llvm/Transforms/Vectorize.h" +#include "llvm/Transforms/Vectorize/LoopVectorize.h" using namespace llvm; @@ -49,10 +50,6 @@ static cl::opt<bool> cl::ZeroOrMore, cl::desc("Run Partial inlinining pass")); static cl::opt<bool> - RunLoopVectorization("vectorize-loops", cl::Hidden, - cl::desc("Run the Loop vectorization passes")); - -static cl::opt<bool> RunSLPVectorization("vectorize-slp", cl::Hidden, cl::desc("Run the SLP vectorization passes")); @@ -167,7 +164,10 @@ PassManagerBuilder::PassManagerBuilder() { Inliner = nullptr; DisableUnrollLoops = false; SLPVectorize = RunSLPVectorization; - LoopVectorize = RunLoopVectorization; + 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. RerollLoops = RunLoopRerolling; NewGVN = RunNewGVN; DisableGVNLoadPRE = false; diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 06b70b3aea6..c82c92f7d2a 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -277,6 +277,13 @@ static cl::opt<bool> VPlanBuildStressTest( "out right after the build (stress test the VPlan H-CFG construction " "in the VPlan-native vectorization path).")); +cl::opt<bool> llvm::EnableLoopInterleaving( + "interleave-loops", cl::init(true), cl::Hidden, + cl::desc("Enable loop interleaving in Loop vectorization passes")); +cl::opt<bool> llvm::EnableLoopVectorization( + "vectorize-loops", cl::init(false), cl::Hidden, + cl::desc("Run the Loop vectorization passes")); + /// A helper function for converting Scalar types to vector types. /// If the incoming type is void, we return void. If the VF is 1, we return /// the scalar type. @@ -6063,6 +6070,8 @@ INITIALIZE_PASS_END(LoopVectorize, LV_NAME, lv_name, false, false) namespace llvm { +Pass *createLoopVectorizePass() { return new LoopVectorize(); } + Pass *createLoopVectorizePass(bool InterleaveOnlyWhenForced, bool VectorizeOnlyWhenForced) { return new LoopVectorize(InterleaveOnlyWhenForced, VectorizeOnlyWhenForced); |

