3 ms·
Is it the right default? If the vast majority of branches are predictable, then without PGO a branch would be the right choice, no? If they're gonna make this
by jabl 4y ago
Is it the right default? If the vast majority of branches are predictable, then without PGO a branch would be the right choice, no?
If they're gonna make this behavior the default, I presume they have lots of benchmarks showing it's generally the correct choice..
- pclmulqdq 4y agoThe vast majority of branches don't fit in the branch predictor, so it is taking no more than a naive guess about them. If you tell LLVM that the branch is likely or unlikely, they shouldn't use a CMOV, and should instead lay out the code so that the naive branch predictor is correct most of the time. Otherwise, the CMOV actually is likely to be beneficial.