[llvm] r183456 - Jeffrey Yasskin volunteered to benchmark the vectorizer on -O2 or -Os when compiling chrome. This patch adds a new flag to enable vectorization on all levels and not only on -O3. It should go away once we make a decision.
Nadav Rotem
nrotem at apple.com
Thu Jun 6 15:35:47 PDT 2013
Author: nadav
Date: Thu Jun 6 17:35:47 2013
New Revision: 183456
URL: http://llvm.org/viewvc/llvm-project?rev=183456&view=rev
Log:
Jeffrey Yasskin volunteered to benchmark the vectorizer on -O2 or -Os when compiling chrome. This patch adds a new flag to enable vectorization on all levels and not only on -O3. It should go away once we make a decision.
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=183456&r1=183455&r2=183456&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Thu Jun 6 17:35:47 2013
@@ -32,6 +32,12 @@ 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"));
@@ -192,7 +198,7 @@ void PassManagerBuilder::populateModuleP
MPM.add(createLoopIdiomPass()); // Recognize idioms like memset.
MPM.add(createLoopDeletionPass()); // Delete dead loops
- if (LoopVectorize && OptLevel > 2)
+ if (LoopVectorize && (OptLevel > 2 || VectorizeO2))
MPM.add(createLoopVectorizePass());
if (!DisableUnrollLoops)
More information about the llvm-commits
mailing list