RyuJIT: Optimize "X / POW2_CNS" via cmovns #41549
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
tenet-performance
Performance related issue
Milestone
Current codegen:
Expected codegen:
This micro-peephole-optimization was added recently in LLVM (PR, see
BuildSDIVPow2
), see godbolt: https://godbolt.org/z/M153rjMy working (ugly) prototype for RyuJIT: EgorBo@9b1d149 (I believe it should be done the other way - I'd introduce a GT_SELECT/GT_CMOV operator so we can later use it for other cmov-based optimizations, e.g. remove branches)
Benchmark
/cc @AntonLapounov
category:cq
theme:basic-cq
skill-level:beginner
cost:small
impact:small
The text was updated successfully, but these errors were encountered: