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

David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 15:39:46 PDT 2016

davidxl added a comment.

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

1. we will never see code region annoated with zero frequency/count
2. for FE PGO, all loop trip count appears to be half of the real trip count.

I will try to improve this situation independently.


More information about the llvm-commits mailing list