[InstrProf] Test that entry coverage counts accumulate #81806
Merged
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.
Entry coverage (
-pgo-function-entry-coverage
) and block covearge (-pgo-block-coverage
) can be useful to reduce the size overhead of instrumented builds, and the profiles they generate can even be used in PGO builds.When merging raw profiles with coverage, we accumulate their values as if they were counts and
llvm-profdata
considers a value to be "covered" if it's larger than zero.llvm-project/llvm/lib/ProfileData/InstrProf.cpp
Lines 841 to 842 in acdb4cd
This is technically different than accumulating counts, but it can help discriminate cold functions from hot functions when the number of raw profiles is large.
See #75425 (comment) for discussion.