[PATCH] D19299: lower __builtin_expect() directly to prof metadata instead of LLVM intrinsic

Sanjay Patel via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 20 14:39:21 PDT 2016

spatel marked 4 inline comments as done.

Comment at: lib/CodeGen/CGBuiltin.cpp:636
@@ -640,1 +635,3 @@
+  case Builtin::BI__builtin_unpredictable:
   case Builtin::BI__builtin_expect: {
+    // Always return the first argument. LLVM does not handle these builtins.
davidxl wrote:
> Can this be reordered with unpredicatle case so that it can handle arg 1 and fall through?
I had coded it that way initially, but I think we must emit the expression for arg0 *before* the expression for arg1.

The ordering is checked by the 'main()' test in the regression test file. If you see a way to code around that, please let me know.


More information about the cfe-commits mailing list