[lld] r314933 - Revert "Revert r314810: Use sched_getaffinity instead of std::thread::hardware_concurrency."

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 13:35:05 PDT 2017


Author: rafael
Date: Wed Oct  4 13:35:05 2017
New Revision: 314933

URL: http://llvm.org/viewvc/llvm-project?rev=314933&view=rev
Log:
Revert "Revert r314810: Use sched_getaffinity instead of std::thread::hardware_concurrency."

This reverts commit r314924.

The required llvm patch was recommitted.

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=314933&r1=314932&r2=314933&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Wed Oct  4 13:35:05 2017
@@ -2235,8 +2235,8 @@ void MergeNoTailSection::finalizeContent
   // operations in the following tight loop.
   size_t Concurrency = 1;
   if (Config->Threads)
-    if (int N = std::thread::hardware_concurrency())
-      Concurrency = std::min<size_t>(PowerOf2Floor(N), NumShards);
+    Concurrency =
+        std::min<size_t>(PowerOf2Floor(hardware_concurrency()), NumShards);
 
   // Add section pieces to the builders.
   parallelForEachN(0, Concurrency, [&](size_t ThreadId) {




More information about the llvm-commits mailing list