[PATCH] D158891: [CSSPGO] Retire FlattenProfileForMatching

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 17:27:10 PDT 2023


hoy 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.
----------------
wlei wrote:
> 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.
I'm a bit confused. `FlattenedProfiles` is immutable once initialized right? What do we lose when using `FSFlattened` for `countProfileMismatches`?

If we are not to count for external functions, the nested callees there will be skipped too? But using a flattened profile can keep them, if they are not external.


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