[PATCH] D15489: Use getEdgeProbability() instead of getEdgeWeight() in BFI and remove getEdgeWeight() interfaces from MBPI.

David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 21:58:47 PST 2015


davidxl added a comment.

Ok.  This is a case where loop exit edge is 'never' taken where the loop backedge is executed. With instrumentation based PGO, even without FE fix up of the 0 weight edge, such as scenario (aka, bad meta data) will never occur, so whatever output of BFI will be fine.

However, with AutoFDO, such MD_prof data can actually be generated . For instance, the function has a single BB loop, and only the BB in the loop has some samples but the entry/exit BB has none.

The BFI result before this patch will most likely under-estimate the loop trip count, while with this patch, it will most likely over-estimate it. I think neither results are ideal, and AutoFDO needs to do something (apply some heuristic) to prevent such case from being generated.  +dehao and +dnovillo for comments.


http://reviews.llvm.org/D15489





More information about the llvm-commits mailing list