RFR: 8343944: C2: MinLNode::add_ring() computes _widen wrongly leading to an endless widening/compilation
Christian Hagedorn
chagedorn at openjdk.org
Tue Nov 12 10:12:04 UTC 2024
In `MinLNode::add_ring()`, we wrongly take the minimum of the `_widen`of both input types instead of the maximum which leads to an endless widening in CCP without reaching a fixed point with the test case. We eventually hit the memlimit because we keep creating new types endlessly.
The fix is straight forward to use `MAX2()` instead of `MIN2()` as we are already doing for `MinINode::add_ring()`:
https://github.com/openjdk/jdk/blob/b53ee053f7f7ffcf02ff47e1895ce7be4bc32486/src/hotspot/share/opto/addnode.cpp#L1437-L1443
Details about how this endless widening is happening are provided as comments in the test case.
Thanks,
Christian
-------------
Commit messages:
- 8343944: C2: MinLNode::add_ring() computes _widen wrongly leading to an endless compilation
Changes: https://git.openjdk.org/jdk/pull/22033/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22033&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8343944
Stats: 81 lines in 2 files changed: 80 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/22033.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/22033/head:pull/22033
PR: https://git.openjdk.org/jdk/pull/22033
More information about the hotspot-compiler-dev
mailing list