Change the PassManagerBuilder (used by -O3) loop vectorizer flag from -vectorize...
authorNadav Rotem <nrotem@apple.com>
Mon, 29 Oct 2012 16:36:25 +0000 (16:36 +0000)
committerNadav Rotem <nrotem@apple.com>
Mon, 29 Oct 2012 16:36:25 +0000 (16:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166937 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ReleaseNotes.html
include/llvm/Transforms/IPO/PassManagerBuilder.h
lib/Transforms/IPO/PassManagerBuilder.cpp

index eb12b339a470dd7c036895f21478c4140c7716fe..fa986a855103fb745319c81e61f5ec718532cd55 100644 (file)
@@ -468,9 +468,10 @@ Release Notes</a>.</h1>
 
 <p> Loop Vectorizer - We've added a loop vectorizer and we are now able to
     vectorize small loops. The loop vectorizer is disabled by default and
-    can be enabled using the <b>-mllvm -vectorize</b> flag.
+    can be enabled using the <b>-mllvm -vectorize-loops</b> flag.
     The SIMD vector width can be specified using the flag
     <b>-mllvm -force-vector-width=4</b>.
+    The defaule value is <b>0</b> which means auto-select.
     <br/>
     We can now vectorize this code:
 
index 47ce90265bd5abb685f976f79a63a6def1691a5e..68557bd5f67e5022864c900ac844169cb5ac9782 100644 (file)
@@ -103,7 +103,8 @@ public:
   bool DisableSimplifyLibCalls;
   bool DisableUnitAtATime;
   bool DisableUnrollLoops;
-  bool Vectorize;
+  bool BBVectorize;
+  bool LoopVectorize;
 
 private:
   /// ExtensionList - This is list of all of the extensions that are registered.
index e3bc94e7e675b687837453fec3bd0514e32a2001..2b16e20e5638058ca994ddea237c53491f0a777a 100644 (file)
 using namespace llvm;
 
 static cl::opt<bool>
-RunVectorization("vectorize", cl::desc("Run vectorization passes"));
+RunLoopVectorization("vectorize-loops", cl::desc("Run the Loop vectorization passes"));
+
+static cl::opt<bool>
+RunBBVectorization("vectorize", cl::desc("Run the BB vectorization passes"));
 
 static cl::opt<bool>
 UseGVNAfterVectorization("use-gvn-after-vectorization",
@@ -52,7 +55,8 @@ PassManagerBuilder::PassManagerBuilder() {
     DisableSimplifyLibCalls = false;
     DisableUnitAtATime = false;
     DisableUnrollLoops = false;
-    Vectorize = RunVectorization;
+    BBVectorize = RunBBVectorization;
+    LoopVectorize = RunLoopVectorization;
 }
 
 PassManagerBuilder::~PassManagerBuilder() {
@@ -185,7 +189,7 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
   MPM.add(createLoopIdiomPass());             // Recognize idioms like memset.
   MPM.add(createLoopDeletionPass());          // Delete dead loops
 
-  if (Vectorize) {
+  if (LoopVectorize) {
     MPM.add(createLoopVectorizePass());
     MPM.add(createLICMPass());
   }
@@ -208,7 +212,7 @@ void PassManagerBuilder::populateModulePassManager(PassManagerBase &MPM) {
 
   addExtensionsToPM(EP_ScalarOptimizerLate, MPM);
 
-  if (Vectorize) {
+  if (BBVectorize) {
     MPM.add(createBBVectorizePass());
     MPM.add(createInstructionCombiningPass());
     if (OptLevel > 1 && UseGVNAfterVectorization)