[llvm] [SampleProfile] Add option to limit number of (indirect) call target and inlined callsites when reading a Sample Profile (PR #74677)

William Junda Huang via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 19:24:21 PST 2023


huangjd wrote:

> Since this is the problem with x-binary FDO, it makes more sense to do this during profile generation? By so doing can also improve profile reading time?

We can limit the number of indirect calls (or do any data sanitizing) at profile generation, but usually a profile is repeatedly merged into other profile or being processed further so we don't want to that too early. The flags added here are more of a safeguard to make sure the input profile is bounded and compilation time will be reasonable. 

> Another question, while we will never ICP more than a few targets, it seems possible that it's beneficial to inline more than 3 callees at the same location? I don't quite understand the limit for call site samples that is not tied to indirect calls.

If not indirect call what situation can led to different functions being inlined into the same location?  This can be a result of merging multiple profiles, but in that case it means the call target in that location can be any of the inlined function, so it is not different from indirect call? 

>  Also for this kind of change, some proof on performance usually should be provided if it's intended to be on by default.

I am collecting performance on some benchmarking program now 


The motivation of this patch is that I came across profiles with thousands of indirect call targets in one sample record, and this clearly doesn't make sense. 




https://github.com/llvm/llvm-project/pull/74677


More information about the llvm-commits mailing list