New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8265973: [lworld] C2 compilation fails due to infinite loop in PhaseIterGVN::optimize #397
Conversation
|
@TobiHartmann This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 7 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the
|
Webrevs
|
/integrate |
@TobiHartmann Since your change was applied there have been 7 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit f43fafc. |
This is another instance of 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 theirbottom_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:valhalla/src/hotspot/share/opto/phaseX.cpp
Lines 1988 to 1992 in 28a4ec0
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:valhalla/src/hotspot/share/opto/memnode.cpp
Lines 352 to 358 in 28a4ec0
The fix is to aggressively remove useless nodes after CCP. I'll consider upstreaming the fix after some bake time in Valhalla.
Thanks,
Tobias
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/valhalla pull/397/head:pull/397
$ git checkout pull/397
Update a local copy of the PR:
$ git checkout pull/397
$ git pull https://git.openjdk.java.net/valhalla pull/397/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 397
View PR using the GUI difftool:
$ git pr show -t 397
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/valhalla/pull/397.diff