From eb1a38fa73b3250683a95875caffa1eac0ae292a Mon Sep 17 00:00:00 2001 From: Arnold Schwaighofer Date: Sun, 26 Oct 2014 21:50:58 +0000 Subject: Add an option to the LTO code generator to disable vectorization during LTO We used to always vectorize (slp and loop vectorize) in the LTO pass pipeline. r220345 changed it so that we used the PassManager's fields 'LoopVectorize' and 'SLPVectorize' out of the desire to be able to disable vectorization using the cl::opt flags 'vectorize-loops'/'slp-vectorize' which the before mentioned fields default to. Unfortunately, this turns off vectorization because those fields default to false. This commit adds flags to the LTO library to disable lto vectorization which reconciles the desire to optionally disable vectorization during LTO and the desired behavior of defaulting to enabled vectorization. We really want tools to set PassManager flags directly to enable/disable vectorization and not go the route via cl::opt flags *in* PassManagerBuilder.cpp. llvm-svn: 220652 --- llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/IPO/PassManagerBuilder.cpp') diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index 92f49d3f645..da85a91c78a 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -444,7 +444,7 @@ void PassManagerBuilder::addLTOOptimizationPasses(PassManagerBase &PM) { // More loops are countable; try to optimize them. PM.add(createIndVarSimplifyPass()); PM.add(createLoopDeletionPass()); - PM.add(createLoopVectorizePass(DisableUnrollLoops, LoopVectorize)); + PM.add(createLoopVectorizePass(true, LoopVectorize)); // More scalar chains could be vectorized due to more alias information if (RunSLPAfterLoopVectorization) -- cgit v1.2.3