[llvm] [PGO] Fix incorrect count threshold calculation when 0% cutoff (PR #117359)
Ken Matsui via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 17 15:10:35 PST 2025
================
@@ -77,9 +77,18 @@ static const uint32_t DefaultCutoffsData[] = {
const ArrayRef<uint32_t> ProfileSummaryBuilder::DefaultCutoffs =
DefaultCutoffsData;
+// An entry for the 0th percentile to correctly calculate hot/cold count
+// thresholds when -profile-summary-cutoff-hot/cold is 0. If the hot cutoff is
+// 0, no sample counts are treated as hot. If the cold cutoff is 0, all sample
+// counts are treated as cold. Assumes there is no UINT64_MAX sample counts.
----------------
ken-matsui wrote:
No, `-profile-summary-cutoff-hot=1000000` (unimplemented) doesn't mean that a function will be hot if its count is larger than 100% of functions. Instead, a function will be hot if its count is larger than a minimum count required to become 100% of functions, i.e., always.
> With this patch, how do I specify `-profile-summary-cutoff-hot` to make all functions hot?
This patch isn't resolving the problem you are referring to. That requires a different patch to handle `-profile-summary-cutoff-hot=1000000`. This patch resolves an issue that 0% cutoff (to make all functions NOT hot) isn't supported.
https://github.com/llvm/llvm-project/pull/117359
More information about the llvm-commits
mailing list