spatel abandoned this revision.
spatel added a comment.
Abandoning.
The feedback on the dev list was that handling the builtin_expect() in clang is
ugly, so it's better to pay a small cost in LLVM to do it.
Note that the current llvm.expect lowering pass doesn't actually work for
anything but the simplest cases. The pass needs to be enhanced to handle
patterns like:
int foo(int x, int y) {
if (__builtin_expect(x, 20) > 10) return 234; // expected value is not 1
return 2;
}
or:
int foo(int n) {
int b = __builtin_expect(n, 1); // expect is not directly used in
comparison
if (b) return 24;
return 234;
}
Currently, the llvm.expect is discarded in these cases without generating any
metadata.
http://reviews.llvm.org/D19299
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits