[lld] 42dc667 - [LLD][ELF] Put back rounding which was lost in 8404aeb56a73ab24f9b295111de3b37a37f0b841

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 29 18:52:13 PDT 2020


Author: Alexandre Ganea
Date: 2020-03-29T21:52:01-04:00
New Revision: 42dc667db248e27a44dc245d5c39ce1f8ad26a85

URL: https://github.com/llvm/llvm-project/commit/42dc667db248e27a44dc245d5c39ce1f8ad26a85
DIFF: https://github.com/llvm/llvm-project/commit/42dc667db248e27a44dc245d5c39ce1f8ad26a85.diff

LOG: [LLD][ELF] Put back rounding which was lost in 8404aeb56a73ab24f9b295111de3b37a37f0b841

Added: 
    

Modified: 
    lld/ELF/SyntheticSections.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index ed2cdb70a2d5..2388b08dd20b 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -2750,7 +2750,8 @@ createSymbols(ArrayRef<std::vector<GdbIndexSection::NameAttrEntry>> nameAttrs,
   size_t concurrency = 1;
   if (threadsEnabled)
     concurrency = std::min<size_t>(
-        hardware_concurrency().compute_thread_count(), numShards);
+        PowerOf2Floor(hardware_concurrency().compute_thread_count()),
+        numShards);
 
   // A sharded map to uniquify symbols by name.
   std::vector<DenseMap<CachedHashStringRef, size_t>> map(numShards);
@@ -3196,7 +3197,8 @@ void MergeNoTailSection::finalizeContents() {
   size_t concurrency = 1;
   if (threadsEnabled)
     concurrency = std::min<size_t>(
-        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) {


        


More information about the llvm-commits mailing list