1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00

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.

llvm-svn: 183456
This commit is contained in:
Nadav Rotem 2013-06-06 22:35:47 +00:00
parent bf1cb89e75
commit df7abce197

View File

@ -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::populateModulePassManager(PassManagerBase &MPM) {
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)