[lld] r300089 - [coff] default to multiple parallel ThinLTO jobs
Bob Haarman via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 11:36:13 PDT 2017
Author: inglorion
Date: Wed Apr 12 13:36:13 2017
New Revision: 300089
URL: http://llvm.org/viewvc/llvm-project?rev=300089&view=rev
Log:
[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
Modified:
lld/trunk/COFF/Config.h
lld/trunk/COFF/LTO.cpp
Modified: lld/trunk/COFF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Config.h?rev=300089&r1=300088&r2=300089&view=diff
==============================================================================
--- lld/trunk/COFF/Config.h (original)
+++ lld/trunk/COFF/Config.h Wed Apr 12 13:36:13 2017
@@ -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;
Modified: lld/trunk/COFF/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/LTO.cpp?rev=300089&r1=300088&r2=300089&view=diff
==============================================================================
--- lld/trunk/COFF/LTO.cpp (original)
+++ lld/trunk/COFF/LTO.cpp Wed Apr 12 13:36:13 2017
@@ -73,7 +73,7 @@ static std::unique_ptr<lto::LTO> createL
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);
More information about the llvm-commits
mailing list