[llvm] [SampleProfile] Annotate always inlined function with flattened samples (PR #221157)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 00:14:57 PDT 2026
================
@@ -2293,6 +2293,10 @@ bool SampleProfileLoader::runOnFunction(Function &F,
Samples = &It->second;
}
}
+ // Try use flattened profile as a fallback when no profile is found as a
----------------
HighW4y2H3ll wrote:
Thanks! let me update the title and summary. I think this may become a problem in two ways: 1) a new caller is introduced and a profile became stale; or 2) unstable samples creating biased profile. Sample loader only annotates the inlinee indeed, but not the inlined function itself which might gets called from other callers. So it might be a missed opportunity to optimize the callee/inlinee function in the other (unprofiled) callchains.
I think it should be fine with the extra annotating. The total sample threshold is computed based on the profile itself, and it is initialized at the very beginning of the sample loader pass. The profile summary or hot/cold threshold shall not be affected regardless.
https://github.com/llvm/llvm-project/pull/221157
More information about the llvm-commits
mailing list