[PATCH] D10979: Update the branch weight metadata in JumpThreading pass.

Cong Hou congh at google.com
Fri Jul 17 11:14:12 PDT 2015


On Fri, Jul 17, 2015 at 11:07 AM, Xinliang David Li <davidxl at google.com> wrote:
>> Here I am actually using the old BB->SuccBB Frequency as
>>
>> BPI->setEdgeWeight({BB, SuccBB}, W);
>>
>> is called after the weight on BB->SuccBB is updated. So the
>> probability is still the old one.
>>
>
> The problem is that when adjusting 'W', you have
>
> auto BBFreq =   BFI->getBlockFreq(BB) * BPI->getEdgeProbability(BB, SuccBB);
>
> Note that this is done after you update BB's frequency:
>
>  BFI->setBlockFreq(BB, NewBBFreq);
>
>
> You old version of the patch is correct though (as it is using the old BBFreq).

Ah, you are right. Thanks for pointing it out. I have updated the
patch to use the old BB frequency.

>
> David
>
>
>>>
>>> http://reviews.llvm.org/D10979
>>>
>>>
>>>



More information about the llvm-commits mailing list