[PATCH] D12341: add llvm.unpredictable intrinsic and lower it to metadata

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 10:18:52 PDT 2015


hfinkel added a comment.

In http://reviews.llvm.org/D12341#234315, @spatel wrote:

> In http://reviews.llvm.org/D12341#234312, @hfinkel wrote:
>
> > Can you please explain why you're adding this intrinsic, instead of just adding branch-probability metadata from the frontend?
>
>
> Hi Hal -
>
> See my earlier question. My reason for implementing it this way was simply because this is the way it's already done for llvm.expect...so I assume there's some case that's better served by having an intrinsic? If that's not true, then certainly this unpredictable hint could be a lot simpler and so could the expect hint?


My understanding is that the way that llvm.expect was implemented is considered to be a mistake that we're now stuck with for backwards-compatibility reasons (and we could fix this and auto-upgrade, but no one has bothered to do this yet, in part, because until recently we still had too many problems with dropping the profiling metadata, and so there were bigger fish to fry).


http://reviews.llvm.org/D12341





More information about the llvm-commits mailing list