Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PGO] Gracefully handle zero entry-count
With sampled instrumentation (llvm#69535), profile counts can appear corrupt. In particular a function can have a 0 block counts for all its blocks, while having some non-zero counters for select instrumentation. This is only possible for colder functions, and a reasonable modification to ensure the entry is non-zero (required by `fixFuncEntryCounts`) is to set the counter to one. This is only likely to happen for colder functions, so it is reasonable to take any action that does not crash.
- Loading branch information