From bac8a5d2822835cf47175d1162030653fadd5c09 Mon Sep 17 00:00:00 2001
From: johannst
The semantics of this hint are as follows, the compiler prioritises expr == cond
. So __builtin_expect(expr, 0)
means that we expect the expr
to be 0
most of the time.
echo "
+echo "
extern void foo();
extern void bar();
void run0(int x) {
@@ -224,7 +224,7 @@ void run1(int x) {
if (__builtin_expect(x,1)) { foo(); }
else { bar(); }
}
-" | gcc -O2 -S -masm=intel -o /dev/stdout -xc -
+" | gcc -O2 -S -masm=intel -o /dev/stdout -xc -
Will generate something similar to the following.
@@ -250,7 +250,7 @@ run1: