summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-lto
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2014-10-26 21:50:58 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2014-10-26 21:50:58 +0000
commiteb1a38fa73b3250683a95875caffa1eac0ae292a (patch)
tree543929cf5600424b70bad9a9645ac54c4a35ab3b /llvm/tools/llvm-lto
parent01db53848e700917583344a20d118ec860629dc5 (diff)
downloadbcm5719-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/llvm-lto')
-rw-r--r--llvm/tools/llvm-lto/llvm-lto.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp
index 0910df14203..3c950ba0502 100644
--- a/llvm/tools/llvm-lto/llvm-lto.cpp
+++ b/llvm/tools/llvm-lto/llvm-lto.cpp
@@ -39,6 +39,10 @@ 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"));
+
+static cl::opt<bool>
UseDiagnosticHandler("use-diagnostic-handler", cl::init(false),
cl::desc("Use a diagnostic handler to test the handler interface"));
@@ -179,8 +183,9 @@ int main(int argc, char **argv) {
if (!OutputFilename.empty()) {
size_t len = 0;
std::string ErrorInfo;
- const void *Code = CodeGen.compile(&len, DisableOpt, DisableInline,
- DisableGVNLoadPRE, ErrorInfo);
+ const void *Code =
+ CodeGen.compile(&len, DisableOpt, DisableInline, DisableGVNLoadPRE,
+ DisableLTOVectorization, ErrorInfo);
if (!Code) {
errs() << argv[0]
<< ": error compiling the code: " << ErrorInfo << "\n";
@@ -200,7 +205,8 @@ int main(int argc, char **argv) {
std::string ErrorInfo;
const char *OutputName = nullptr;
if (!CodeGen.compile_to_file(&OutputName, DisableOpt, DisableInline,
- DisableGVNLoadPRE, ErrorInfo)) {
+ DisableGVNLoadPRE, DisableLTOVectorization,
+ ErrorInfo)) {
errs() << argv[0]
<< ": error compiling the code: " << ErrorInfo
<< "\n";
OpenPOWER on IntegriCloud