[PATCH] D31986: [coff] default to multiple parallel ThinLTO jobs

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 11:24:49 PDT 2017


inglorion created this revision.
Herald added subscribers: Prazek, mehdi_amini.

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.


https://reviews.llvm.org/D31986

Files:
  COFF/Config.h
  COFF/LTO.cpp


Index: COFF/LTO.cpp
===================================================================
--- COFF/LTO.cpp
+++ COFF/LTO.cpp
@@ -73,7 +73,7 @@
     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);
Index: COFF/Config.h
===================================================================
--- COFF/Config.h
+++ COFF/Config.h
@@ -115,7 +115,7 @@
   unsigned LTOOptLevel = 2;
 
   // Used for /opt:lldltojobs=N
-  unsigned LTOJobs = 1;
+  unsigned LTOJobs = 0;
   // Used for /opt:lldltopartitions=N
   unsigned LTOPartitions = 1;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31986.95004.patch
Type: text/x-patch
Size: 889 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170412/5097993c/attachment.bin>


More information about the llvm-commits mailing list