[PATCH] D38266: Parallelize string merging.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 27 01:59:44 PDT 2017
grimar added inline comments.
================
Comment at: lld/ELF/SyntheticSections.cpp:2241
+ if (Sec->Pieces[I].Live && Sec->Hashes[I] % NumShards == ShardId)
+ Sec->Pieces[I].OutputOff = Shards[ShardId].add(Sec->getData(I));
+ });
----------------
Will it be better to calculate Begin and End instead of iterating over all pieces and using constructions like `Sec->Hashes[I] % NumShards == ShardId` ?
Something like:
```
size_t TaskSize = Sec->Pieces.size() / NumShards;
size_t I = TaskSize * ShardId;
size_t E = (ShardId == NumShards - 1) ? Sec->Pieces.size() : I + TaskSize;
```
https://reviews.llvm.org/D38266
More information about the llvm-commits
mailing list