Revert "Revert r314810: Use sched_getaffinity instead of std::thread::hardware_concur...
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 4 Oct 2017 20:35:05 +0000 (20:35 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 4 Oct 2017 20:35:05 +0000 (20:35 +0000)
This reverts commit r314924.

The required llvm patch was recommitted.

llvm-svn: 314933

lld/ELF/SyntheticSections.cpp

index e850ed0..a07ac8c 100644 (file)
@@ -2235,8 +2235,8 @@ void MergeNoTailSection::finalizeContents() {
   // 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) {