[PATCH] D38528: Parallelize tail-merge string table construction.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 01:30:24 PDT 2019


ruiu added a comment.

This patch naturally changes the order how strings are placed in a merged string section. In addition to that, with this change, strings equal to or shorter than 4 bytes long are not merged. This is why.

Assume we have two string, "cd" and "abcd". They have the same tail.

Since we use a hash value of the last 4 characters of each string as a shard ID, we compute two hashes, H1 <https://reviews.llvm.org/H1>=hash_vaule("cd") and H2 <https://reviews.llvm.org/H2>=hash_value("abcd"). It is unlikely that H1 <https://reviews.llvm.org/H1>==H2 <https://reviews.llvm.org/H2> because they are just different strings. Therefore, it is likely that "cd" and "abcd" are added to different shards, and they are not merged.

Due to the above behavior, I needed to make the strings used in the test little longer, as otherwise they wouldn't have been merged at all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D38528/new/

https://reviews.llvm.org/D38528





More information about the llvm-commits mailing list