3 ms·
The 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 lik
by pclmulqdq 4y ago
The 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.