-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[PGO] Fix incorrect count threshold calculation when 0% cutoff #117359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+17
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a typo? Or am I misunderstanding these flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it is not a typo.
-profile-summary-cutoff-hot: A count is hot if it exceeds the minimum count to reach this percentile of total counts.-profile-summary-cutoff-cold: A count is cold if it is below the minimum count to reach this percentile of total counts.When cutoff is 0, the minimum count is UINT64_MAX. So, when a count exceeds UINT64_MAX, it is hot, meaning no counts are hot. Similarly, when a count is below UINT64_MAX, it is cold, meaning all counts are cold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this can be accomplished with
-profile-summary-cutoff-hot=1000000. A function will be hot if its count is larger than 100% of functions, which is impossible. So no functions are hot. Likewise,-profile-summary-cutoff-cold=1000000should make all functions cold. Why do we need a special case for these? With this patch, how do I specify-profile-summary-cutoff-hotto make all functions hot?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.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.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation and the clarification! LGTM