[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
This commit is contained in:
Bob Haarman 2017-04-12 18:36:13 +00:00
parent 336c78fdbe
commit dd4b4325ee
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -73,7 +73,7 @@ static std::unique_ptr<lto::LTO> 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<lto::LTO>(std::move(Conf), Backend,
Config->LTOPartitions);