<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I tried to avoid unnecessary code duplication, but I can revert it and add the functionality to CodeGenPrepare instead.<div class=""><br class=""></div><div class="">—Juergen<br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 9, 2014, at 8:48 AM, Chandler Carruth <<a href="mailto:chandlerc@google.com" class="">chandlerc@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Dec 9, 2014 at 5:36 PM, Juergen Ributzka <span dir="ltr" class=""><<a href="mailto:juergen@apple.com" target="_blank" class="">juergen@apple.com</a>></span> wrote:<br class=""><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 class="">
Date: Tue Dec  9 10:36:06 2014<br class="">
New Revision: 223784<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=223784&view=rev" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=223784&view=rev</a><br class="">
Log:<br class="">
Move function to obtain branch weights into the BranchInst class. NFC.<br class="">
<br class="">
Make this function available to other parts of LLVM.</div></blockquote></div><br class=""></div><div class="gmail_extra">I completely disagree with this API change.</div><div class="gmail_extra"><br class=""></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>
</div></blockquote></div><br class=""></div></div></body></html>