[PATCH] D153486: [llvm-profdata] GUIDToFuncNameMap can be static

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 16:47:40 PDT 2023

wenlei added a comment.

In D153486#4445610 <https://reviews.llvm.org/D153486#4445610>, @davidxl wrote:

> We should consider having singleton instance and use LLVM's synchronization support to guard updating. Assuming updating the map is rare so the contention should have low runtime impact.

Essentially this is per-module map that needs to be accessed from FunctionSamples. For local (non-distributed) ThinLTO, each thin-backend thread will build part of the map (for symbols in that module) and access that part of the map, so write is not uncommon and contention could be common. I think TLS is the best option if it's available to use.

OTOH, what's the total size of FunctionSamples, and how significant is saving 8 byte in it?

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list