<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 27, 2015 at 3:13 PM, Kevin B. Smith via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">kbsmith1 added a comment.<br>
<br>
No, I am not suggesting you have more history.  I am suggesting that you only have a single number that represents the percentage of time that the direction is mispredicted.  It would make a lot of sense for it to be a simple 0-100 value, and would represent the percentage of mispredictions. Anything else takes more space, and is much too closely tied to the branch predictor.<br></blockquote><div><br></div><div>I have seen 2 independent bug reports recently where the simple annotation to the compiler "assume that this is completely unpredictable" would have been the solution. Some pieces of code very closely approximate this, especially in decompression algorithms where by definition if the encoder is doing its job then the pattern cannot be guessed. Other data-driven branches can approximate this behavior as well.</div><div><br></div><div>This is more a declaration about the actual pattern of the branch. A number indicating the percentage of mispredictions (or any empirically collected number) is not a generalization of this annotation.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
ABAB can be perfectly predicted often, AABB can be perfectly predicted often. The number of transitions from true to false or vice-versa has a poor<br>
correlation to branch predictability, just as the branch probability has a poor correlation to branch predictability.<br>
<div class=""><div class="h5"><br>
<br>
<a href="http://reviews.llvm.org/D12341" rel="noreferrer" target="_blank">http://reviews.llvm.org/D12341</a><br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>