This patch depends on D12341 ('unpredictable' metadata type for LLVM).
For now, I am ignoring the horrible thought that this builtin might take an extra parameter to distinguish different hardware. :)
The goal is to make LLVM generate different code for these functions for a target that has cheap branches (see PR23827 for more details):
int foo();
int normal(int x, int y, int z) {
if (x != 0 && y != 0) return foo();
return 1;
}
int crazy(int x, int y) {
if (__builtin_unpredictable(x != 0 && y != 0)) return foo();
return 1;
}