[PATCH] Fix information loss in branch probability computation.

Hans Wennborg hans at chromium.org
Thu May 7 08:57:30 PDT 2015


On Thu, May 7, 2015 at 8:51 AM, Diego Novillo <dnovillo at google.com> wrote:
> 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!)

I've updated the switch lowering code to handle 0 weights without
tampering with them in r236739.

Thanks,
Hans



More information about the llvm-commits mailing list