__builtin_expect
from GCC can be used by programmer to show which variants are expected to be very often and which are rare. But __builtin_expect
have only "true" and "false" (0% or 100% probability)
For some big projects it is vary hard to get profile feedback (-fprofile-arcs
), and sometimes programmer does know, what probability of branch he have in some point of program.
It is possible to give a hint to compiler that a branch have probability >0% and <100% ?