[llvm] [Sample Profile] Check hot callsite threshold when inlining a function with a sample profile (PR #93286)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 09:21:54 PDT 2024


WenleiHe wrote:

The change is okay but I'm curious who triggered it and have you verify its effectiveness? Asking because the effect of is likely small because if sample loader see a candidate, that means this candidate has been inlined in previous build, so it has passed the threshold/size check in the previous build. Is this change triggered by an actual pathological case where this is leading to huge callee inlined? If so, I'm curious how that happened.

> For example if a function is calling another very large function multiple times (at different code paths), the large function should not be inlined even if its hot.

This should not happen today, the nested callsite / inlinee profile naturally carry context-sensitivity. When determining hotness for sample loader inlining, call site hotness is checked, instead of context-less callee hotness. 

cc @helloguo @wlei-llvm 

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


More information about the llvm-commits mailing list