[PATCH] D158891: [CSSPGO] Retire FlattenProfileForMatching

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 17:03:48 PDT 2023


wlei added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:2402
+    // Use top-level nested FS for counting profile mismatch metrics since
+    // currently once a callsite is mismatched, all its children profile are
+    // dropped.
----------------
hoy wrote:
> nit: profile -> profiles
> 
> > once a callsite is mismatched, all its children profile are drooped
> 
> Why children profiles can be dropped? Counting happens before inlining right?
yeah, In the current  `findCalleeFunctionSamples` implementation, if the mismatch happens, it would return null, but there is no extra process to reuse those samples, so it's "dropped".

I think as Wenlei has proposed a solution in other patch: 
>Maybe what we should actually do is to reuse the nested profile from those mismatched parent functions, something like run promoteMergeNotInlinedContextSamples on top level functions samples not used? We do reuse nested profile for not inlined callees from parent function.

That sounds reasonable, but as we talked offline, we could leave it in future.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158891



More information about the llvm-commits mailing list