2 ms·
Choice of cmov vs branch is pretty tricky because profitability depends on branch probabilities, which are commonly not known. LLVM has an X86 cmov conversion p
by nikic 7y ago
Choice of cmov vs branch is pretty tricky because profitability depends on branch probabilities, which are commonly not known. LLVM has an X86 cmov conversion pass that does this based on some cost modeling for loop-carried dependencies, but it does not always make the right choice. Common problem is binary search code where you really, really want that cmov, but might not get it.