[PATCH] D61540: [PGO] Use sum of count values to fix func entry count and add a check to verify BFI counts
Rong Xu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 19 15:03:55 PST 2020
xur added inline comments.
================
Comment at: llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp:1657
+ uint64_t FuncEntryCount = Func.getBBInfo(&*F.begin()).CountValue;
+ uint64_t NewEntryCount = 0.5 + FuncEntryCount * Scale;
+ if (NewEntryCount == 0)
----------------
davidxl wrote:
> Perhaps take the max of the original func entry count and the new entry count?
Not sure if want a max here. Here a value of 1 makes the sum of raw counters and sum of BFI counters close to each other, better than original func entry count.
Using max will never reduce the entry count -- I don't think that is what we want.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61540/new/
https://reviews.llvm.org/D61540
More information about the llvm-commits
mailing list