[PATCH] Fix information loss in branch probability computation.

Diego Novillo dnovillo at google.com
Thu May 7 08:51:19 PDT 2015


On Thu, May 7, 2015 at 8:44 AM, Duncan P. N. Exon Smith
<dexonsmith at apple.com> wrote:

> This assertion will fire under circumstances such as:
>
>   - `1` successor has a weight of `3`.
>   - `UINT32_MAX - 2` successors have a weight of `0` each.
>
> This won't get rescaled by the new BPI, but it violates the local
> assumptions (with the floor, the sum will be `UINT32_MAX + 1`).

Oh, absolutely. But that's not a problem now. Hans is going to rewrite
the balancing algorithm to tolerate 0 weights. With that, I will be
able to simplify the patch. I'll wait for that fix before committing
(thanks Hans!)


Thanks.  Diego.



More information about the llvm-commits mailing list