[llvm] r223784 - Move function to obtain branch weights into the BranchInst class. NFC.

Juergen Ributzka juergen at apple.com
Tue Dec 9 08:55:42 PST 2014


I tried to avoid unnecessary code duplication, but I can revert it and add the functionality to CodeGenPrepare instead.

—Juergen

> On Dec 9, 2014, at 8:48 AM, Chandler Carruth <chandlerc at google.com> wrote:
> 
> 
> On Tue, Dec 9, 2014 at 5:36 PM, Juergen Ributzka <juergen at apple.com <mailto:juergen at apple.com>> wrote:
> Author: ributzka
> Date: Tue Dec  9 10:36:06 2014
> New Revision: 223784
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=223784&view=rev <http://llvm.org/viewvc/llvm-project?rev=223784&view=rev>
> Log:
> Move function to obtain branch weights into the BranchInst class. NFC.
> 
> Make this function available to other parts of LLVM.
> 
> I completely disagree with this API change.
> 
> 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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141209/0e8a80b5/attachment.html>


More information about the llvm-commits mailing list