Copy from the PR description: https://github.com/openjdk/jdk/pull/9642
I would like to propose an ideal transform that converts floating point multiplication by 2 (x * 2) into an addition operation instead. This would allow for the elimination of the memory reference for the constant two, and keep the whole operation inside registers. My justifications for this optimization include:
- As per Agner Fog's instruction tables many older systems, such as the sandy bridge and ivy bridge architectures, have different latencies for addition and multiplication meaning this change could have beneficial effects when in hot code.
- The removal of the memory load would have a beneficial effect in cache-bound situations.
- Multiplication by 2 is a relatively common construct so this change can apply to a wide range of Java code.
I would like to propose an ideal transform that converts floating point multiplication by 2 (x * 2) into an addition operation instead. This would allow for the elimination of the memory reference for the constant two, and keep the whole operation inside registers. My justifications for this optimization include:
- As per Agner Fog's instruction tables many older systems, such as the sandy bridge and ivy bridge architectures, have different latencies for addition and multiplication meaning this change could have beneficial effects when in hot code.
- The removal of the memory load would have a beneficial effect in cache-bound situations.
- Multiplication by 2 is a relatively common construct so this change can apply to a wide range of Java code.
- relates to
-
JDK-8297294 compiler/c2/irTests/TestMulNodeIdealization.java failed compilation
-
- Resolved
-