Commit 073a689
committed
[PGO] Fix incorrect count threshold calculation when 0% cutoff
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, samples are
not incorrectly recognized as hot or cold.1 parent 4389220 commit 073a689
File tree
2 files changed
+14
-0
lines changed- llvm
- lib/ProfileData
- test/Analysis/ProfileSummary
2 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
0 commit comments