diff options
| author | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-10-26 21:50:58 +0000 |
|---|---|---|
| committer | Arnold Schwaighofer <aschwaighofer@apple.com> | 2014-10-26 21:50:58 +0000 |
| commit | eb1a38fa73b3250683a95875caffa1eac0ae292a (patch) | |
| tree | 543929cf5600424b70bad9a9645ac54c4a35ab3b /llvm/tools/lto | |
| parent | 01db53848e700917583344a20d118ec860629dc5 (diff) | |
| download | bcm5719-llvm-eb1a38fa73b3250683a95875caffa1eac0ae292a.tar.gz bcm5719-llvm-eb1a38fa73b3250683a95875caffa1eac0ae292a.zip | |
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
Diffstat (limited to 'llvm/tools/lto')
| -rw-r--r-- | llvm/tools/lto/lto.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/tools/lto/lto.cpp b/llvm/tools/lto/lto.cpp index 3389425915d..3cc6499bd90 100644 --- a/llvm/tools/lto/lto.cpp +++ b/llvm/tools/lto/lto.cpp @@ -32,6 +32,10 @@ static cl::opt<bool> DisableGVNLoadPRE("disable-gvn-loadpre", cl::init(false), cl::desc("Do not run the GVN load PRE pass")); +static cl::opt<bool> +DisableLTOVectorization("disable-lto-vectorization", cl::init(false), + cl::desc("Do not run loop or slp vectorization during LTO")); + // Holds most recent error string. // *** Not thread safe *** static std::string sLastErrorString; @@ -252,7 +256,8 @@ const void *lto_codegen_compile(lto_code_gen_t cg, size_t *length) { parsedOptions = true; } return unwrap(cg)->compile(length, DisableOpt, DisableInline, - DisableGVNLoadPRE, sLastErrorString); + DisableGVNLoadPRE, DisableLTOVectorization, + sLastErrorString); } bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) { @@ -261,8 +266,9 @@ bool lto_codegen_compile_to_file(lto_code_gen_t cg, const char **name) { lto_add_attrs(cg); parsedOptions = true; } - return !unwrap(cg)->compile_to_file(name, DisableOpt, DisableInline, - DisableGVNLoadPRE, sLastErrorString); + return !unwrap(cg)->compile_to_file( + name, DisableOpt, DisableInline, DisableGVNLoadPRE, + DisableLTOVectorization, sLastErrorString); } void lto_codegen_debug_options(lto_code_gen_t cg, const char *opt) { |

