[llvm-commits] BlockFrequency for BasicBlocks

Andrew Trick atrick at apple.com
Wed Jun 22 17:47:08 PDT 2011


Where do you check underflow of block frequency? It seems that 10 sequential branches with default weights would result in getEdgeFreq() returning zero.

I'm not sure what getBackSumForBlock() means. The previous code looks correct to me. Can you explain the problem that you're solving?

Thanks.

-Andy

On Jun 22, 2011, at 2:39 PM, Jakub Staszak wrote:

> 
> On Jun 21, 2011, at 8:21 PM, Andrew Trick wrote:
> 
>> 
>> Yes, by "1" I meant literal 1, not scaled 1. I think this could happen inside getEdgeFreq() when (N * getBlockFreq(Src)) < D. You should probably check for that case and return the smallest nonzero frequency.
>> 
>> You actually shouldn't have a problem in divBlockFreq, but somewhere you should assert that the input BranchProbability is well-formed (N < D).
> 
> The bug was in the complete different place. Instead of using backedge probability info (probability of getting to DST block through SRC block) i used edge probability. It caused some problem in very rare cases (only during benchmarking).
> 
> 
>> -Andy
>> 
>> 
> <bf4bb.5.patch>




More information about the llvm-commits mailing list