[llvm] r184084 - Enable the loop vectorizer by default for -Os and -O2.

Nadav Rotem nrotem at apple.com
Mon Jun 17 09:23:34 PDT 2013


Author: nadav
Date: Mon Jun 17 11:23:34 2013
New Revision: 184084

URL: http://llvm.org/viewvc/llvm-project?rev=184084&view=rev
Log:
Enable the loop vectorizer by default for -Os and -O2.

Modified:
    llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp

Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=184084&r1=184083&r2=184084&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Mon Jun 17 11:23:34 2013
@@ -32,12 +32,6 @@ static cl::opt<bool>
 RunLoopVectorization("vectorize-loops",
                      cl::desc("Run the Loop vectorization passes"));
 
-// This is a helper flag that we use for testing the profitability of
-// vectorization on -O2 and -Os. It should go away once we make a decision.
-static cl::opt<bool>
-VectorizeO2("vectorize-o2",
-            cl::desc("Enable vectorization on all O levels"));
-
 static cl::opt<bool>
 RunSLPVectorization("vectorize-slp",
                     cl::desc("Run the SLP vectorization passes"));
@@ -198,7 +192,7 @@ void PassManagerBuilder::populateModuleP
   MPM.add(createLoopIdiomPass());             // Recognize idioms like memset.
   MPM.add(createLoopDeletionPass());          // Delete dead loops
 
-  if (LoopVectorize && (OptLevel > 2 || VectorizeO2))
+  if (LoopVectorize && (OptLevel > 1))
     MPM.add(createLoopVectorizePass());
 
   if (!DisableUnrollLoops)





More information about the llvm-commits mailing list