RFR: 8278471: Reorder optimizations in addnode Ideal [v2]

Mai Đặng Quân Anh duke at openjdk.java.net
Mon Dec 13 10:56:09 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.

Hi, I think just deleting those 2 should be okay.

Regarding idealisation, if you look into `PhaseGVN::transform`, it is clear that `Node::Ideal` is called repeatedly until there is nothing change anymore. Then `Node::Value` is called to do constant propagation before `Node::Identity` is called to get rid of redundant operations. Finally, value numbering is the transformation which deduplicates all equivalent `Node`s into a single one.

https://github.com/openjdk/jdk/blob/ccdb9f1b160a0f49ee86c7a2714d2381d68419cc/src/hotspot/share/opto/phaseX.cpp#L828

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

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


More information about the hotspot-compiler-dev mailing list