[PATCH] D126344: [memprof] Keep and display symbol names in the RawMemProfReader.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 13:24:58 PDT 2022


tejohnson accepted this revision.
tejohnson added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: llvm/lib/ProfileData/RawMemProfReader.cpp:419
+        if (KeepSymbolName)
+          GuidToSymbolName.insert({Guid, DIFrame.FunctionName});
 
----------------
snehasish wrote:
> tejohnson wrote:
> > Why not add the function name into the Frame here rather than waiting for the later call to idToFrame() and filling it from the map then?
> The idea here is to save memory by not duplicating the symbol names since we can have many unique frames (a combination of symbol + location). Also the processing does not require the symbol name today, so we only populate it in the iterator interface where a single MemProfRecord object is instantiated at a time.
Another alternative, to avoid the repeated map lookups later on, is to make SymbolName a StringRef and keep a StringSet of the unique strings for ownership.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126344



More information about the llvm-commits mailing list