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

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 27 17:35:20 PDT 2023


wenlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/CSPreInliner.cpp:84
+  // profile from run to run.
+  uint64_t ColdCountThreshold = ProfileSummaryBuilder::getColdCountThreshold(
+      (Summary->getDetailedSummary()));
----------------
hoy wrote:
> wenlei wrote:
> > I understand that you want to do this only for preinliner, not for sample loader in compiler. But the current way of doing this - exposing internals of profiled calll graph only for users to tweak the actual graph, is less than idea as it breaks the abstraction. 
> > 
> > Can we have a separate parameter (i.e. hotCallonly) for ctor of ProfiledCallGraph, so this is all self contained? And perhaps slight more efficient as it avoids add and then removal. 
> I can pass in the threshold and do the trimming in place inside `ProfiledCallGraph`, wdyt?
> 
> Perhaps we have to add the edges first and then remove the cold ones after the weight accumulation is done.
Sounds good. 

(I'm still leaning towards something like hotEdgesOnly as extra argument to keep the interface simple. But I can see that we will need to pass in ProfileSummary anyways, so passing a threshold value directly sounds good.)


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