<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>To the cyclic_probability we have to add backedge probability, it is probability of getting to the DST block through the SRC block. In the original algorithm we used floating point numbers, but here we use integers with START_FREQ = 1024, thus we have to "normalize" the value and look at it as a probability  where 1024 is equal to 1.0. </div><div><br></div><div>Previously we used getEdgeFreq which is wrong, because sum of them for some BB from all its predecessors might be greater than START_FREQ.</div><div><br></div><div>BTW: I forgot to delete DSE.cpp part, which is use for the testing purpose.</div><div><br class="webkit-block-placeholder"></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>-Kuba</div></span>
</div>
<br><div><div>On Jun 22, 2011, at 5:47 PM, Andrew Trick wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Where do you check underflow of block frequency? It seems that 10 sequential branches with default weights would result in getEdgeFreq() returning zero.<br><br>I'm not sure what getBackSumForBlock() means. The previous code looks correct to me. Can you explain the problem that you're solving?<br><br>Thanks.<br><br>-Andy<br><br>On Jun 22, 2011, at 2:39 PM, Jakub Staszak wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On Jun 21, 2011, at 8:21 PM, Andrew Trick wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">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.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">You actually shouldn't have a problem in divBlockFreq, but somewhere you should assert that the input BranchProbability is well-formed (N < D).<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">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).<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">-Andy<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><bf4bb.5.patch><br></blockquote><br></div></blockquote></div><br></body></html>