RFR: 8278471: Reorder optimizations in addnode Ideal [v2]
Mai Đặng Quân Anh
duke at openjdk.java.net
Sat Dec 11 16:36:17 UTC 2021
On Fri, 10 Dec 2021 04:19:39 GMT, Zhiqiang Zang <duke at openjdk.java.net> wrote:
>> Reorder optimizations in addnode so special cases appear before general cases; otherwise the special cases would be never covered.
>>
>> `(a - b) + (c - d)` subsumes both `(a - b) + (b - c)` and `(a - b) + (c - a)`. Therefore `(a - b) + (b - c)` and `(a - b) + (c - a)` have to be placed before `(a - b) + (c - d)` so that they can work.
>
> Zhiqiang Zang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
>
> - Merge master.
> - Merge master.
> - reorder optimizations in addnode so special cases appear before general cases.
We actually don't need those since `(x - c) + (c - y)` would be transformed into `(x + c) - (c + y)` which will be transformed into `x - y` anyway. So you can safely remove them completely.
https://github.com/openjdk/jdk/blob/10a51fdb05abe7f7be76a9c442bd4564b24010de/src/hotspot/share/opto/subnode.cpp#L256
-------------
PR: https://git.openjdk.java.net/jdk/pull/6752
More information about the hotspot-compiler-dev
mailing list