[PATCH] Fix information loss in branch probability computation.

Diego Novillo dnovillo at google.com
Thu May 7 07:30:35 PDT 2015


On Wed, May 6, 2015 at 4:18 PM, Duncan P. N. Exon Smith
<dexonsmith at apple.com> wrote:

> The new assertion doesn't check the sum though, and the sum can now
> overflow because of the floor.

Oh, right. Silly me.

> I think if you want to go this way, you need to:
>
>  1. Check that sum in use is small enough after adding 1 to all the
>     weights.
>  2. If it overflows, rescale everything locally.
>
> It's probably simpler just to split the two changes in BPI into two
> patches, or roll in the change to `visitSwitch()`.

Sorry. I'm not sure I follow you here. If I split the changes to BPI
from the change in visitSwitch(), I'll run into the existing assertion
in visitSwitch() (one of the tests fails). Or do you mean, rolling in
the algorithmic changes to visitSwitch()?


Thanks. Diego.



More information about the llvm-commits mailing list