Open tbillington opened 2 months ago
Are you sure it is faster? llvm-mca say it will be slower (506 vs 304 cycles).
ifelse()
is indeed slower, benchmarked with criterion. So if anything, the question should be the opposite.
@rustbot label -C-bug +I-slow -needs-triage +A-LLVM +C-optimization
fwiw, filed an issue in llvm: https://github.com/llvm/llvm-project/issues/107034
I assume the following two functions behave identically, and therefore should result in the same codegen. https://godbolt.org/z/vj9ornqbG
However,
ifelse
fails to be optimised to a cast.