JIT can reuse a comparison between two locals but fails to do so for two readonly fields #95844
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
tenet-performance
Performance related issue
Milestone
Description
For the snippet below, MinMaxA has worse codegen than MinMaxB:
In MinMaxA, the JIT performs the comparison between the fields twice, while in MinMaxB it is able to see that the comparison between two locals only needs to happen once.
Configuration
Locally I'm running 8.0.100, Windows x64. The above disasm I took from Sharplab.
The text was updated successfully, but these errors were encountered: