-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8335708: C2: Compile::verify_graph_edges must start at root and safepoints, just like CCP traversal #23977
Conversation
👋 Welcome back marc-chevalier! A progress list of the required criteria for merging this PR into |
@marc-chevalier 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 182 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@eme64, @chhagedorn) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@marc-chevalier 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. |
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.
Nice work, and thanks again for the offline discussion :)
I left a few comments / suggestions below.
Ah, and you could also consider changing the PR name. Maybe something like graph verification must start at root and safepoints, just like CCP traversal
. Maybe you have an even better idea ;)
* @run main/othervm | ||
* -XX:-TieredCompilation -XX:+VerifyGraphEdges | ||
* -XX:+StressIGVN -Xcomp | ||
* -XX:CompileCommand=compileonly,compiler.loopopts.Test8335708::mainTest | ||
* compiler.loopopts.Test8335708 |
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.
Can you please add a run without any flags? Sometimes that allows other bugs to trigger, because it can then be used without any flags, or other flag combinations.
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.
Done. I hope it's the right way.
@@ -0,0 +1,69 @@ | |||
/* |
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.
Can you rename the test file? I think the new common practice is to give it a descriptive name, rather than just the bug number which is already tracked under @bug 8335708
anyway ;)
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.
Done. I think it's more explicit.
Node_List nstack(MAX2(stack_size, (uint)OptoNodeListSize)); | ||
nstack.push(_root); | ||
Node_List nstack(MAX2(stack_size, (uint) OptoNodeListSize)); | ||
if (root_and_safepoints != nullptr) { |
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.
Can you say in which cases we don't have root_and_safepoints
? Why is it ok not to also start at SafePoint in those cases?
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.
I think you should also say that we start the traversal from Root and Safepoints, just like during CCP.
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.
I've improved the comment on the declaration of verify_graph_edges
: it is the only caller of verify_bidirectional_edges
, which acts more like a helper, and verify_graph_edges
is the one called a bit everywhere. Also, I think it's not an implementation detail, but a signature/contract thing: when writing a call to verify_graph_edges
, I must know what I need to provide in root_and_safepoints
, or when I can omit it. So now, I hope it's documented.
I don't understand what you mean. the title of the PR must match the JBS ticket. I have very little creative freedom there. No? |
You can always change both, so that they match ;) |
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.
@marc-chevalier Looks good to me, except for missing punctuation ;)
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.
Some minor comments. Otherwise, looks good to me, too!
I applied your fixes. I don't think I need proper review again, but I need re-approval. EDIT: nevermind, @chhagedorn was faster than me. |
/integrate Thanks for the reviews! |
@marc-chevalier |
/sponsor |
Going to push as commit 2bc4f64.
Your commit was automatically rebased without conflicts. |
@TobiHartmann @marc-chevalier Pushed as commit 2bc4f64. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
In CCP, we transform the nodes going up (toward inputs) starting from root and safepoints because infinite loops can be reachable from the root, but not co-reachable from the root, that is one can follow def-use from root to the loop, but not the use-def from root to loop. For more details, see:
jdk/src/hotspot/share/opto/phaseX.cpp
Lines 2063 to 2070 in 4cf6316
Since we are specifically marking nodes as useful if they are above a safepoint, the check that no dead nodes must be there anymore must also consider nodes above a safepoint as alive: the same criterion must apply. We should nevertheless not start from a safepoint killed by CCP.
About the test, I use this trick found in
TestInfiniteLoopCCP
because I indeed need a really infinite loop, but I want a terminating test. The crash is not deterministic, as it needs StressIGVN, so I did a bit of stats. Using a little helper script, on 100 runs, 69 runs fail as in the JBS ticket and 31 are successful (so 0 fail in another way). After the fix, I find 100 successes.And thanks to @eme64 who extracted such a concise reproducer.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23977/head:pull/23977
$ git checkout pull/23977
Update a local copy of the PR:
$ git checkout pull/23977
$ git pull https://git.openjdk.org/jdk.git pull/23977/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23977
View PR using the GUI difftool:
$ git pr show -t 23977
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23977.diff
Using Webrev
Link to Webrev Comment