[PATCH] Fix information loss in branch probability computation.

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu May 7 09:06:35 PDT 2015


> On 2015 May 7, at 11:57, Hans Wennborg <hans at chromium.org> wrote:
> 
> 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.

Ah!  I didn't understand this was going on in parallel.  Sorry for being
out of it.

I'll go back and review the patch.



More information about the llvm-commits mailing list