RFR: 8277882: New subnode ideal optimization: converting "c0 - (x + c1)" into "(c0 - c1) - x"

Mai Đặng Quân Anh duke at openjdk.java.net
Mon Nov 29 03:40:35 UTC 2021


On Wed, 17 Nov 2021 22:50:41 GMT, Zang, Zhiqiang <duke at openjdk.java.net> wrote:

> Suggest two new optimizations that can be done in SubINode::Ideal.

Hi,
Regarding your first transformation, `x - (0 - y)` is already transformed into `(x + y) - 0` which is then simplified to `x + y`, see line 265.
Consider merging your second transformation with the one in line 243, too.
Cheers.

You should provide a microbenchmark to prove the effectiveness of the transformations, too.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6441


More information about the hotspot-compiler-dev mailing list