[PATCH] D38266: Parallelize string merging.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 20:33:35 PDT 2017


ruiu 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));
+  });
----------------
grimar wrote:
> 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;
> ```
That won't work because it doesn't guarantee to produce a minimum table.


https://reviews.llvm.org/D38266





More information about the llvm-commits mailing list