Displaying 3 results from an estimated 3 matches for "9c99036c".
2018 May 09
0
Ignored branch predictor hints
I did
https://bugs.llvm.org/show_bug.cgi?id=37368
2018-05-09 20:33 GMT+02:00 Dávid Bolvanský <david.bolvansky at gmail.com>:
> I did
>
> https://bugs.llvm.org/show_bug.cgi?id=37368
>
> 2018-05-09 20:29 GMT+02:00 David Zarzycki <dave at znu.io>:
>
>> I’d wager that the if-else chain is being converted to a "switch
>> statement” during an optimization
2018 May 09
2
Ignored branch predictor hints
..._________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180509/9c99036c/attachment.html>
2018 May 09
3
Ignored branch predictor hints
Hello,
#define likely(x) __builtin_expect((x),1)
// switch like
char * b(int e) {
if (likely(e == 0))
return "0";
else if (e == 1)
return "1";
else return "f";
}
GCC correctly prefers the first case:
b(int):
mov eax, OFFSET FLAT:.LC0
test edi, edi
jne .L7
ret
But Clang seems to ignore _builtin_expect hints in this case.