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

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 16:38:39 PDT 2015


spatel added a comment.

In http://reviews.llvm.org/D12341#234428, @hfinkel wrote:

> The problem with the intrinsic is that ... it confuses information about a value with information about a branch based on that value.


Do you see this being different than __builtin_expect() in Clang? If it's information about the branch itself, do we have:

  __builtin_unpredictable_if( MyCondition ) { ... }

If it's about the condition, then it looks like the existing __builtin_expect:

  if ( __builtin_unpredictable( MyCondition ) { ... }

...but we'll have to propagate the metadata from the condition value to branches that use it in Clang? Or does unpredictable metadata stick to a value in Clang and then the backend is responsible for tracking back to that metadata when looking at branches?


http://reviews.llvm.org/D12341





More information about the llvm-commits mailing list