diff options
author | Teresa Johnson <tejohnson@google.com> | 2016-10-19 17:35:01 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2016-10-19 17:35:01 +0000 |
commit | ec544c552ed63cc0e21ccddf342023084c9b904f (patch) | |
tree | 41b3cceb5a8f43a6b7849deb5b3c0825bbf335f4 /llvm/lib/LTO/ThinLTOCodeGenerator.cpp | |
parent | 69d7cf0d41cc7e41967c16aab471bf9db71ed468 (diff) | |
download | bcm5719-llvm-ec544c552ed63cc0e21ccddf342023084c9b904f.tar.gz bcm5719-llvm-ec544c552ed63cc0e21ccddf342023084c9b904f.zip |
[ThinLTO] Default backend threads to heavyweight_hardware_concurrency
Summary:
Changes default backend parallelism from thread::hardware_concurrency to
the new llvm::heavyweight_hardware_concurrency, which for X86 Linux
defaults to the number of physical cores (and will fall back to
thread::hardware_concurrency otherwise). This avoid oversubscribing
the physical cores using hyperthreading.
Reviewers: mehdi_amini, pcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25775
llvm-svn: 284618
Diffstat (limited to 'llvm/lib/LTO/ThinLTOCodeGenerator.cpp')
-rw-r--r-- | llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index 10af9870ccb..578b3e88b01 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -43,6 +43,7 @@ #include "llvm/Support/SHA1.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/ThreadPool.h" +#include "llvm/Support/Threading.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/IPO/FunctionImport.h" @@ -64,8 +65,8 @@ extern cl::opt<bool> LTODiscardValueNames; namespace { -static cl::opt<int> ThreadCount("threads", - cl::init(std::thread::hardware_concurrency())); +static cl::opt<int> + ThreadCount("threads", cl::init(llvm::heavyweight_hardware_concurrency())); static void diagnosticHandler(const DiagnosticInfo &DI) { DiagnosticPrinterRawOStream DP(errs()); |