diff options
| author | Nadav Rotem <nrotem@apple.com> | 2013-06-06 22:35:47 +0000 | 
|---|---|---|
| committer | Nadav Rotem <nrotem@apple.com> | 2013-06-06 22:35:47 +0000 | 
| commit | 99e529ea3c68ab927971038d5eafc1dc5b5f4a44 (patch) | |
| tree | 0d8f662c086410138288a321c42ca6dc460168e8 /llvm/lib/Transforms | |
| parent | de2ae19cf6048efc38d47af09831e1786db4ee0a (diff) | |
| download | bcm5719-llvm-99e529ea3c68ab927971038d5eafc1dc5b5f4a44.tar.gz bcm5719-llvm-99e529ea3c68ab927971038d5eafc1dc5b5f4a44.zip  | |
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
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index 986c0b8928c..8ed7704d5a0 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/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)  | 

