[PATCH] D94111: [CSSPGO][llvm-profgen] Merge and trim profile for cold context to reduce profile size

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 16:29:03 PST 2021


hoy added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:33
+    "csprof-cold-thres", cl::init(100), cl::ZeroOrMore,
+    cl::desc("Specified the total samples threshold for a context profile to "
+             "be considered cold, any cold profiles will be merged into "
----------------
wlei wrote:
> hoy wrote:
> > Nit: Specify
> > 
> > I was wondering in the future if we'd like a consistent way of computing cold threshold with `SampleProfileSummaryBuilder`, i.e., counts below 99.9% (aka cut-off) are considered cold, so that the profile generator and the profile consumer will be on the same page.
> Thanks for sharing this. I'm not sure how we get the 100 threshold, I guess this is the result of many iterations. Let me dig into the `SampleProfileSummaryBuilder` to see the chance.
Yes, it is a number from experiments. The logic in the profile summary builder is a bit different in that it sorts all samples by weight and treats the samples below a given percentage (say 0.01%) as cold. In order words, if there are more than 99.99% samples that are hotter than the current one, then the current is treated as cold. That's the logic used in the compiler.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94111



More information about the llvm-commits mailing list