Files
clang-p2996/llvm/lib/ProfileData/ProfileSummaryBuilder.cpp
Ken Matsui 2847e1501e [PGO] Fix incorrect count threshold calculation when 0% cutoff (#117359)
DefaultCutoffsData does not have an entry for the 0th percentile. As a
result, when the getEntryForPercentile method is called with a
percentile argument of 0, it returns a ProfileSummaryEntry for the 1st
percentile instead. This behavior affects the threshold calculations,
such as getHotCountThreshold, causing them to incorrectly identify some
sample profile counts as hot when they should not be.

This patch addresses the issue by handling the 0th percentile case in
the getEntryForPercentile method. This ensures that when the
-profile-summary-cutoff-hot (or -cold) option is set to 0, no sample
counts are treated as hot (or all sample counts are treated as cold).
2025-02-18 15:51:17 -05:00

9.8 KiB