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

Chandler Carruth chandlerc at google.com
Tue Dec 9 08:48:39 PST 2014


On Tue, Dec 9, 2014 at 5:36 PM, Juergen Ributzka <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
> 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/1eb2ce44/attachment.html>


More information about the llvm-commits mailing list