[LLVMdev] Loss of precision with very large branch weights

Xinliang David Li davidxl at google.com
Fri Apr 24 11:44:10 PDT 2015


On Fri, Apr 24, 2015 at 11:36 AM, Diego Novillo <dnovillo at google.com> wrote:
>
>
> On Fri, Apr 24, 2015 at 2:32 PM, Xinliang David Li <davidxl at google.com>
> wrote:
>>
>> Since we have decided to capture the global hotness using function
>> entry count, it is ok to CAP the max weight as of today. I think the
>> remaining bug in PR22718 is that when capping happens, the scaling is
>> not done. That needs to be fixed.
>
>
> The problem here is that the two loops show up equally hot. So the function
> entry count for bar() won't really help since it seems like both loops call
> bar() equally frequently.
>

Isn't that the direct result of  the branch weights not being scaled
(after reaching the cap) -- thus leading to wrong branch probability
(computed from weights)? Wrong probability leads to wrong Frequency
propagation.

David

>>
>> The efficiency of the interface is a different issue.
>>
>
> Yeah. I'm looking at the hotness calculation first.
>
>
> Diego.



More information about the llvm-dev mailing list