[PATCH] D24118: [JumpThreading] Only write back branch-weight MDs for blocks that originally had PGO info

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 18:23:44 PDT 2016

anemet added a comment.

In https://reviews.llvm.org/D24118#532156, @davidxl wrote:

> There is a fundamental problem in BFI that it can not handle 0 weight -- to workaround it
> 1. FE PGO annotator will always add 1 to weights of both targets unconditionally when annotating the branch
> 2. BFI always add 1 to the weight if it is zero.
>   The end result is that
> 3. we will never see code region annoated with zero frequency/count

Ah, that totally explains what's happening here.  Is there a PR?

> 2. for FE PGO, all loop trip count appears to be half of the real trip count.

Wow, this was going to be next thing for me to investigate, thanks for the insights!


More information about the llvm-commits mailing list