[lld] r314924 - Revert r314810: Use sched_getaffinity instead of std::thread::hardware_concurrency.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 4 11:39:51 PDT 2017
Author: ruiu
Date: Wed Oct 4 11:39:51 2017
New Revision: 314924
URL: http://llvm.org/viewvc/llvm-project?rev=314924&view=rev
Log:
Revert r314810: Use sched_getaffinity instead of std::thread::hardware_concurrency.
This reverts commit r314810 because r314809 was reverted.
Modified:
lld/trunk/ELF/SyntheticSections.cpp
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=314924&r1=314923&r2=314924&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Oct 4 11:39:51 2017
@@ -2235,8 +2235,8 @@ void MergeNoTailSection::finalizeContent
// operations in the following tight loop.
size_t Concurrency = 1;
if (Config->Threads)
- Concurrency =
- std::min<size_t>(PowerOf2Floor(hardware_concurrency()), NumShards);
+ if (int N = std::thread::hardware_concurrency())
+ Concurrency = std::min<size_t>(PowerOf2Floor(N), NumShards);
// Add section pieces to the builders.
parallelForEachN(0, Concurrency, [&](size_t ThreadId) {
More information about the llvm-commits
mailing list