-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8296318: use-def assert: special case undetected loops nested in infinite loops #11642
Conversation
👋 Welcome back epeter! A progress list of the required criteria for merging this PR into |
Webrevs
|
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.
That looks reasonable!
@eme64 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. 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 8 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 ➡️ To integrate this PR with the above commit message to the |
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.
Please, merge latest JDK so that GHA builds pass.
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.
Thanks @vnkozlov @chhagedorn for the reviews and suggestions! |
Going to push as commit 736fcd4.
Your commit was automatically rebased without conflicts. |
PhaseCFG::verify
checks that the nodes scheduled into the blocks have "use-after-def".jdk/src/hotspot/share/opto/block.cpp
Line 1376 in 8c472e4
As long as the control flow has no loops, this should always hold.
We make sure to not check the assert if the block-head is a
LoopNode
, and the usen
is aPhi
, since we may have inputs from the backedge, which would be "use-before-def" in the block-scheduling order, but that is to be expected.jdk/src/hotspot/share/opto/block.cpp
Line 1364 in 8c472e4
Problem
This assumes that all loops are properly detected, if a loop was not detected the block-head may only be a
RegionNode
, and the assert can fail (see regression test). Why are not all loops detected?During
PhaseIdealLoop::build_loop_tree
, we detect all loops, but not always attach infinite loops with their sub-loops to the loop tree, and then the loop-headRegions
are not converted toLoopNodes
inPhaseIdealLoop::beautify_loops
.This behaviour is expected, see also #11473.
Thus, the assert fires, but it should not.
Solution
Add special casing to assert: also accept if the
Region
is in an infinite subgraph, and we are looking at aPhi
as use (the def could be values from the backedge).Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/11642/head:pull/11642
$ git checkout pull/11642
Update a local copy of the PR:
$ git checkout pull/11642
$ git pull https://git.openjdk.org/jdk pull/11642/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 11642
View PR using the GUI difftool:
$ git pr show -t 11642
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/11642.diff