[PATCH] D10979: Update the branch weight metadata in JumpThreading pass.
Xinliang David Li
davidxl at google.com
Fri Jul 17 11:07:36 PDT 2015
> 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).
David
>>
>> http://reviews.llvm.org/D10979
>>
>>
>>
More information about the llvm-commits
mailing list