Skip to content

Commit 42dc667

Browse files
committed
[LLD][ELF] Put back rounding which was lost in 8404aeb
1 parent 12f6b02 commit 42dc667

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lld/ELF/SyntheticSections.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,7 +2750,8 @@ createSymbols(ArrayRef<std::vector<GdbIndexSection::NameAttrEntry>> nameAttrs,
27502750
size_t concurrency = 1;
27512751
if (threadsEnabled)
27522752
concurrency = std::min<size_t>(
2753-
hardware_concurrency().compute_thread_count(), numShards);
2753+
PowerOf2Floor(hardware_concurrency().compute_thread_count()),
2754+
numShards);
27542755

27552756
// A sharded map to uniquify symbols by name.
27562757
std::vector<DenseMap<CachedHashStringRef, size_t>> map(numShards);
@@ -3196,7 +3197,8 @@ void MergeNoTailSection::finalizeContents() {
31963197
size_t concurrency = 1;
31973198
if (threadsEnabled)
31983199
concurrency = std::min<size_t>(
3199-
hardware_concurrency().compute_thread_count(), numShards);
3200+
PowerOf2Floor(hardware_concurrency().compute_thread_count()),
3201+
numShards);
32003202

32013203
// Add section pieces to the builders.
32023204
parallelForEachN(0, concurrency, [&](size_t threadId) {

0 commit comments

Comments
 (0)