[PATCH] D61540: [PGO] Use sum of count values to fix func entry count and add a check to verify BFI counts

Rong Xu via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 10:23:12 PST 2020


On Wed, Nov 18, 2020 at 5:48 PM Wenlei He via Phabricator <
reviews at reviews.llvm.org> wrote:

> wenlei added a subscriber: hoy.
> wenlei added a comment.
>
> > We record function entry count and branch weights and use them to
> compute the count when needed. This mechanism works well in a perfect
> world, but often breaks in real programs
>
> We're battling this exact problem from sample PGO side. And we have
> internal patches for comparing block counts from BFI with ground truth.
> Perhaps these all can be refactored to be shared between Instr PGO and
> sample PGO. + at hoy
>
> How does fixing up entry count alone help mitigate this problem?
>
As I mentioned earlier in this review, the raw profile is inconsistent and
the information is not sufficient to recover the loss. Nevertheless, the
probabilities for most of the branches are OK. BFI uses  the entry counter
and all the individual branch probability to compute the BFI. We don't want
to touch branch probability as they are set in the counter propagation
stage with the best information they have. Here we adjust the entry counter
to make the BFI count and raw count closer. I think that's probably the
best we can do.

>
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D61540/new/
>
> https://reviews.llvm.org/D61540
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201119/39ffd611/attachment.html>


More information about the llvm-commits mailing list