aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-07 09:31:26 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-07 09:31:26 +0000
commitb84d18f57604b86ce2cae5a2447a5f879153bc0f (patch)
treea3ea42a8a4c70cb564bd9471cea87b88e16ccd38 /tools
parent7b7037563b12589e675c655e5d1e4f737f50fa9d (diff)
downloadexternal_llvm-b84d18f57604b86ce2cae5a2447a5f879153bc0f.zip
external_llvm-b84d18f57604b86ce2cae5a2447a5f879153bc0f.tar.gz
external_llvm-b84d18f57604b86ce2cae5a2447a5f879153bc0f.tar.bz2
Merging r196294:
------------------------------------------------------------------------ r196294 | arnolds | 2013-12-03 08:33:06 -0800 (Tue, 03 Dec 2013) | 7 lines opt: Mirror vectorization presets of clang clang enables vectorization at optimization levels > 1 and size level < 2. opt should behave similarily. Loop vectorization and SLP vectorization can be disabled with the flags -disable-(loop/slp)-vectorization. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/opt/opt.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 8a8da01..dba16f7 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -139,6 +139,16 @@ static cl::opt<bool>
DisableLoopUnrolling("disable-loop-unrolling",
cl::desc("Disable loop unrolling in all relevant passes"),
cl::init(false));
+static cl::opt<bool>
+DisableLoopVectorization("disable-loop-vectorization",
+ cl::desc("Disable the loop vectorization pass"),
+ cl::init(false));
+
+static cl::opt<bool>
+DisableSLPVectorization("disable-slp-vectorization",
+ cl::desc("Disable the slp vectorization pass"),
+ cl::init(false));
+
static cl::opt<bool>
DisableSimplifyLibCalls("disable-simplify-libcalls",
@@ -461,8 +471,10 @@ static void AddOptimizationPasses(PassManagerBase &MPM,FunctionPassManager &FPM,
Builder.DisableUnrollLoops = (DisableLoopUnrolling.getNumOccurrences() > 0) ?
DisableLoopUnrolling : OptLevel == 0;
- Builder.LoopVectorize = OptLevel > 1 && SizeLevel < 2;
- Builder.SLPVectorize = true;
+ Builder.LoopVectorize =
+ DisableLoopVectorization ? false : OptLevel > 1 && SizeLevel < 2;
+ Builder.SLPVectorize =
+ DisableSLPVectorization ? false : OptLevel > 1 && SizeLevel < 2;
Builder.populateFunctionPassManager(FPM);
Builder.populateModulePassManager(MPM);