8279837: C2: assert(is_Loop()) failed: invalid node class: Region #94
Conversation
|
@chhagedorn The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good. This reminds me similar fix I did in JDK 11u: JDK-8268360
@chhagedorn 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 no new commits pushed to the
|
Yes, that looks very similar. Thanks Vladimir for your review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Thanks Tobias for your review! |
/integrate |
Going to push as commit 65eb066. |
@chhagedorn Pushed as commit 65eb066. |
In the test case, we are attempting to apply
iteration_split_impl()
to a loop head which is aRegionNode
and not aLoopNode
. We then fail with an assertion when attempting to cast it.This is quite an edge case.
build_loop_tree()
is initially adding aNeverBranch
to an infinite inner loop. Afterwards,beautify_loop()
makes progress on some other loop nest where the inner and outer loop share the same loop head. As a result,build_loop_tree()
is called again:jdk18/src/hotspot/share/opto/loopnode.cpp
Lines 4184 to 4189 in 5aecb37
Through
Root
->Halt
->CProj
->NeverBranch
, the infinite loop is now reachable and is built as child of_ltree_root
. However, theRegion
is not yet aLoop
node. This will only happen in the next iteration of loop opts whenbeautify_loop()
is called again. We then fail with the assertion assuming that loop tree head nodes are alwaysLoopNodes
. Some more details can be found in the comments of the test.The fix is straight forward to bail out of
iteration_split_impl()
for non-LoopNodes
. We already do a similar bailout in other optimizations like loop predication:jdk18/src/hotspot/share/opto/loopPredicate.cpp
Lines 1427 to 1430 in 5aecb37
Thanks,
Christian
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk18 pull/94/head:pull/94
$ git checkout pull/94
Update a local copy of the PR:
$ git checkout pull/94
$ git pull https://git.openjdk.java.net/jdk18 pull/94/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 94
View PR using the GUI difftool:
$ git pr show -t 94
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk18/pull/94.diff