RFR: 8277882: New subnode ideal optimization: converting "c0 - (x + c1)" into "(c0 - c1) - x" [v2]
Dean Long
dlong at openjdk.java.net
Tue Nov 30 01:31:15 UTC 2021
On Mon, 29 Nov 2021 03:44:46 GMT, Zang, Zhiqiang <duke at openjdk.java.net> wrote:
>> Suggest two new optimizations that can be done in SubINode::Ideal.
>
> Zang, Zhiqiang has updated the pull request incrementally with one additional commit since the last revision:
>
> clean.
Changes requested by dlong (Reviewer).
I think your tests need to check more cases, especially cases that use MIN_VALUE, MAX_VALUE, or otherwise cause underflow or overflow.
src/hotspot/share/opto/subnode.cpp line 197:
> 195: jint c1 = phase->type(in2->in(2))->isa_int()->get_con();
> 196: return new SubINode(phase->intcon(java_subtract(c0, c1)), in2->in(1));
> 197: }
Should this code be checking for counted loops like below (see ok_to_convert)?
-------------
PR: https://git.openjdk.java.net/jdk/pull/6441
More information about the hotspot-compiler-dev
mailing list