<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 9, 2014 at 5:36 PM, Juergen Ributzka <span dir="ltr"><<a href="mailto:juergen@apple.com" target="_blank">juergen@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":15p" class="a3s" style="overflow:hidden">Author: ributzka<br>
Date: Tue DecĀ  9 10:36:06 2014<br>
New Revision: 223784<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=223784&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=223784&view=rev</a><br>
Log:<br>
Move function to obtain branch weights into the BranchInst class. NFC.<br>
<br>
Make this function available to other parts of LLVM.</div></blockquote></div><br></div><div class="gmail_extra">I completely disagree with this API change.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Most code should not be accessing branch weights this way. It gives the illusion that these can be directly used for deducing profile information when they cannot. Only code *updating* branches needs to get at the raw metadata. Such code is relatively rare I would expect. Even if we need *some* interface on BranchInst to help with the update scenario, this is certainly not it. The weights are not restricted to uint64_t in any meaningful way, nor are output parameters really appropriate. Nor does this interface really help with *updating* the metadata... Maybe I don't understand what you're trying to do here?</div></div>