From: Bob Haarman Date: Wed, 12 Apr 2017 18:36:13 +0000 (+0000) Subject: [coff] default to multiple parallel ThinLTO jobs X-Git-Tag: llvmorg-5.0.0-rc1~7913 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd4b4325ee2658ec5eff34bb6e695f6071a4dd61;p=platform%2Fupstream%2Fllvm.git [coff] default to multiple parallel ThinLTO jobs Summary: lld-link allows the number of parallel ThinLTO jobs to be specified using /opt:lldltojobs=N. If left unspecified, the implementation conservatively defaults to 1. This leads to very long link times. This change makes it so that the default is to automatically set the parallelism, as we do in the ELF linker. Reviewers: ruiu, hans Reviewed By: ruiu, hans Subscribers: pcc, mehdi_amini, Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D31986 llvm-svn: 300089 --- diff --git a/lld/COFF/Config.h b/lld/COFF/Config.h index 72f8249..31534ae 100644 --- a/lld/COFF/Config.h +++ b/lld/COFF/Config.h @@ -115,7 +115,7 @@ struct Configuration { unsigned LTOOptLevel = 2; // Used for /opt:lldltojobs=N - unsigned LTOJobs = 1; + unsigned LTOJobs = 0; // Used for /opt:lldltopartitions=N unsigned LTOPartitions = 1; diff --git a/lld/COFF/LTO.cpp b/lld/COFF/LTO.cpp index 298b71f..6883b3b 100644 --- a/lld/COFF/LTO.cpp +++ b/lld/COFF/LTO.cpp @@ -73,7 +73,7 @@ static std::unique_ptr createLTO() { checkError(Conf.addSaveTemps(std::string(Config->OutputFile) + ".", /*UseInputModulePath*/ true)); lto::ThinBackend Backend; - if (Config->LTOJobs != -1u) + if (Config->LTOJobs != 0) Backend = lto::createInProcessThinBackend(Config->LTOJobs); return llvm::make_unique(std::move(Conf), Backend, Config->LTOPartitions);