Add an option to the LTO code generator to disable vectorization during LTO
authorArnold Schwaighofer <aschwaighofer@apple.com>
Sun, 26 Oct 2014 21:50:58 +0000 (21:50 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Sun, 26 Oct 2014 21:50:58 +0000 (21:50 +0000)
commitb26fb77d9b452d89856684480de48c2493a6b0fc
tree15951bdd42cd09adafc7caa59f903a0ce263546a
parent9a6482a8407fb0f9f2e805cc3f6354ab0e7a448b
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220652 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/LTO/LTOCodeGenerator.h
lib/LTO/LTOCodeGenerator.cpp
lib/Transforms/IPO/PassManagerBuilder.cpp
tools/llvm-lto/llvm-lto.cpp
tools/lto/lto.cpp