[PATCH] D52049: [ThinLTOCodeGenerator] Avoid Rehash StringMap in ThreadPool

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 13 11:10:27 PDT 2018


steven_wu added a comment.

I can't find a super clean solution for this. Here is one possible solution, which is to iterate and insert the entry before entering thread pool

Alternatives are:

- Using lookup, which might copy construct std::map
- Using find, together with some default constructed value.
- Pre-allocate a larger StringMap, and hope rehash doesn't happen.

Let me know which one is preferred or there are better ones.


Repository:
  rL LLVM

https://reviews.llvm.org/D52049





More information about the llvm-commits mailing list