[lworld] Integrated: 8265973: [lworld] C2 compilation fails due to infinite loop in PhaseIterGVN::optimize
thartmann at openjdk.java.net
Thu May 6 09:01:28 UTC 2021
On Fri, 30 Apr 2021 12:26:26 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> This is another instance of [JDK-8264586](https://bugs.openjdk.java.net/browse/JDK-8264586). The fix was not sufficient. The root cause is a subgraph that becomes unreachable from the bottom (but remains reachable from the top) after CCP removes a redundant null check.
> **Gory details:**
> CCP has two phases. First, `PhaseCCP::analyze` visits all nodes and updates their types in `_types.map`. Then, `PhaseCCP::do_transform` only visits the nodes that are reachable from the bottom, updates their `bottom_type` and adds them to the IGVN worklist. During the second step, parts of the graph might be cut off (for example, due to a null-check that is found to be redundant) and the nodes of that subgraph are not visited. I.e., the following code is not executed:
> As a result, `LoadNodes` in the dead subgraph end up with types that are inconsistent with their bottom types. Since they are still reachable from the top, they will be processed by IGVN and then re-enqueued for IGVN indefinitely by this code:
> The fix is to aggressively remove useless nodes after CCP. I'll consider upstreaming the fix after some bake time in Valhalla.
This pull request has now been integrated.
Author: Tobias Hartmann <thartmann at openjdk.org>
Stats: 106 lines in 7 files changed: 80 ins; 11 del; 15 mod
8265973: [lworld] C2 compilation fails due to infinite loop in PhaseIterGVN::optimize
More information about the valhalla-dev