[llvm] [PGO] Ensure non-zero entry-count after `populateCounters` (PR #112029)
Michael O'Farrell via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 18 09:16:21 PDT 2024
================
@@ -1624,8 +1624,12 @@ void PGOUseFunc::populateCounters() {
FuncMaxCount = std::max(FuncMaxCount, *BI->Count);
}
- // Fix the obviously inconsistent entry count.
- if (FuncMaxCount > 0 && FuncEntryCount == 0)
+ // Fix the obviously inconsistent entry count. A function that has all zero
+ // counters will skip populating the counters so a minimum entry count of 1
+ // makes sense. Note that the presence of a non-zero counter does not imply
+ // FuncMaxCount is greater than zero because the only non-zero counts could
+ // be for select instrumentation which is handled later.
+ if (FuncEntryCount == 0)
----------------
mofarrell wrote:
Ah I see. yeah I can do that.
https://github.com/llvm/llvm-project/pull/112029
More information about the llvm-commits
mailing list