summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-06-06 22:35:47 +0000
committerNadav Rotem <nrotem@apple.com>2013-06-06 22:35:47 +0000
commit9342b9ccdd3f99ad76cdcb03b4c6f557517dd0d8 (patch)
tree567cff118e0f5ec2cf096a508f5bb51e05ba0d97 /lib/Transforms
parentbabfebb4e804dbce12c7133860609aa8a2da48fd (diff)
downloadllvm-9342b9ccdd3f99ad76cdcb03b4c6f557517dd0d8.tar.gz
llvm-9342b9ccdd3f99ad76cdcb03b4c6f557517dd0d8.tar.bz2
llvm-9342b9ccdd3f99ad76cdcb03b4c6f557517dd0d8.tar.xz
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183456 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/IPO/PassManagerBuilder.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/PassManagerBuilder.cpp b/lib/Transforms/IPO/PassManagerBuilder.cpp
index 986c0b8928..8ed7704d5a 100644
--- a/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -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)