<div dir="ltr">We should probably just remove the adjustment here. <div>1) for IR based instrumentation (-fprofile-generate/-fprofile-use), the profile annotator does not add 1 to with branch weight when annotating the branch, so do the 'reverse' here would be wrong for IR based PGO</div><div>2) for FE based instrumentation (-fprofile-instr-generate/-fpofile-instr-use), the weight does get adjusted (by adding 1 to both targets of the branch). For loops that execute only once, the estimated trip count would be wrong without adjustment. However the belief is that hot loops usually will be executed/entered many times, so the impact of this to trip count estimation will be small. </div><div>I also believe that longer term, PGO users for perfromance will shift to 1) while 2) is for coverage testing, so we making the estimation for 1) correct is the right thing to do.</div><div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 15, 2016 at 4:42 PM, Adam Nemet <span dir="ltr"><<a href="mailto:anemet@apple.com" target="_blank">anemet@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">anemet added a comment.<br>
<span class=""><br>
In <a href="https://reviews.llvm.org/D25963#596582" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25963#596582</a>, @mkuper wrote:<br>
<br>
> Thanks, Adam!<br>
>  I'll fix the cosmetics, but I'm still not sure what to do about the branch weight adjustments.<br>
<br>
<br>
</span>Wasn't @davidxl working on fixing them?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D25963" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25963</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>