Add an option -vectorize-slp-aggressive for running the BB vectorizer. Make -fslp...
authorNadav Rotem <nrotem@apple.com>
Mon, 15 Apr 2013 05:39:58 +0000 (05:39 +0000)
committerNadav Rotem <nrotem@apple.com>
Mon, 15 Apr 2013 05:39:58 +0000 (05:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179508 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 952c21c4dd9d03ba6d2da455eb40941c75ad96f4..563721e1282516741daf826b5d4016e2800b70f3 100644 (file)
@@ -103,6 +103,7 @@ public:
   bool DisableSimplifyLibCalls;
   bool DisableUnitAtATime;
   bool DisableUnrollLoops;
+  bool BBVectorize;
   bool SLPVectorize;
   bool LoopVectorize;
 
index d611bed9168386eeb7dedaa9a2a5d5026788986c..60957d2c314fd3268c17604f4255cfc279e91125 100644 (file)
@@ -33,7 +33,12 @@ RunLoopVectorization("vectorize-loops",
                      cl::desc("Run the Loop vectorization passes"));
 
 static cl::opt<bool>
-RunSLPVectorization("vectorize-slp", cl::desc("Run the SLP vectorization passes"));
+RunSLPVectorization("vectorize-slp",
+                    cl::desc("Run the SLP vectorization passes"));
+
+static cl::opt<bool>
+RunBBVectorization("vectorize-slp-aggressive",
+                    cl::desc("Run the BB vectorization passes"));
 
 static cl::opt<bool>
 UseGVNAfterVectorization("use-gvn-after-vectorization",
@@ -52,6 +57,7 @@ PassManagerBuilder::PassManagerBuilder() {
     DisableSimplifyLibCalls = false;
     DisableUnitAtATime = false;
     DisableUnrollLoops = false;
+    BBVectorize = RunBBVectorization;
     SLPVectorize = RunSLPVectorization;
     LoopVectorize = RunLoopVectorization;
 }
@@ -208,6 +214,11 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
   addExtensionsToPM(EP_ScalarOptimizerLate, MPM);
 
   if (SLPVectorize) {
+    MPM.add(createSLPVectorizerPass());
+    MPM.add(createEarlyCSEPass());
+  }
+
+  if (BBVectorize) {
     MPM.add(createBBVectorizePass());
     MPM.add(createInstructionCombiningPass());
     if (OptLevel > 1 && UseGVNAfterVectorization)