This intrinsic provides the compiler with branch prediction information. Calling __builtin_expect(expr, , c) informs the compiler that it is expected that expr == c.
Note
This builtin function is a GNU compiler extension that is supported by the ARM compiler.
long __builtin_expect(long int expr, long int c)
Where:
expris an integral expression
cis a compile‑time constant.
__builtin_expect returns the value of expr.
if (__builtin_expect(i, 0))
{
foo(); // we do not expect foo to be called,
} // because we expect i to be zero