From 42dc667db248e27a44dc245d5c39ce1f8ad26a85 Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Sun, 29 Mar 2020 21:51:45 -0400 Subject: [PATCH] [LLD][ELF] Put back rounding which was lost in 8404aeb56a73ab24f9b295111de3b37a37f0b841 --- lld/ELF/SyntheticSections.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index ed2cdb7..2388b08 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2750,7 +2750,8 @@ createSymbols(ArrayRef> nameAttrs, size_t concurrency = 1; if (threadsEnabled) concurrency = std::min( - hardware_concurrency().compute_thread_count(), numShards); + PowerOf2Floor(hardware_concurrency().compute_thread_count()), + numShards); // A sharded map to uniquify symbols by name. std::vector> map(numShards); @@ -3196,7 +3197,8 @@ void MergeNoTailSection::finalizeContents() { size_t concurrency = 1; if (threadsEnabled) concurrency = std::min( - hardware_concurrency().compute_thread_count(), numShards); + PowerOf2Floor(hardware_concurrency().compute_thread_count()), + numShards); // Add section pieces to the builders. parallelForEachN(0, concurrency, [&](size_t threadId) { -- 2.7.4