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

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 10:22:56 PST 2015


For the following CFG:

BB1(weight:100)
BB2(weight:1000)
BB3(weight:100)

BB1->BB2(probability: 0%)
BB1->BB3(probability: 100%)
BB2->BB2(probability: 100%)
BB2->BB3(probability: 0%)

Is there a way we can rebuild BB weights from probability?
Dehao

On Mon, Dec 14, 2015 at 9:58 PM, David Li <davidxl at google.com> wrote:
> 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