[PATCH] D147013: [CSSPGO][Preinliner] Trim cold call edges of the profiled call graph for a more stable profile generation.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 28 09:06:40 PDT 2023


hoy added inline comments.


================
Comment at: llvm/tools/llvm-profgen/CSPreInliner.cpp:82
+  // profile from run to run.
+  uint64_t ColdCountThreshold = ProfileSummaryBuilder::getColdCountThreshold(
+      (Summary->getDetailedSummary()));
----------------
wlei wrote:
> I kinda remember we discussed offline that you tested for trimming hot edges vs trimming cold edges, how about other threshold, like trimming non-hot edges, or it's just a balance, then I'm wondering if other value can perform better, in that case we can tune a new threshold?
Good question. With the cold threshold, CSSPGO profile goes up to 99% similar run to run, so using hot threshold isn't that helpful and it also regresses performance a little bit.


================
Comment at: llvm/tools/llvm-profgen/CSPreInliner.cpp:84
+      (Summary->getDetailedSummary()));
+  ProfiledCallGraph ProfiledCG(ContextTracker, ColdCountThreshold + 1);
 
----------------
wenlei wrote:
> why is +1 needed? if cold threshold is 0, nothing is cold, and we filter out nothing -- it just works? 
There are still zero-weight edges coming from callstack unwinding and they do not show up in the profile. I think. we want to trim them.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147013



More information about the llvm-commits mailing list