-
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
8263577: C2: reachable nodes shouldn't have dead uses at the end of optimizations #3012
Conversation
👋 Welcome back roland! A progress list of the required criteria for merging this PR into |
@rwestrel |
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.
Looks good.
Changes in src/hotspot/share/opto/subtypenode.cpp
don't look relevant. I assume new verification logic uncovered a problem there. Does it make sense to integrate the fix separately?
src/hotspot/share/opto/node.hpp
Outdated
int replace_edge(Node* old, Node* neww); | ||
int replace_edges_in_range(Node* old, Node* neww, int start, int end); | ||
int replace_edge(Node* old, Node* neww, PhaseGVN* gvn = NULL); | ||
int replace_edges_in_range(Node* old, Node* neww, int start, int end, PhaseGVN* gv); |
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.
s/gv/gvn/
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.
right. Will fix that.
@rwestrel 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 32 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. ➡️ To integrate this PR with the above commit message to the |
In the case of subtypenode.cpp, some nodes were created and never attached to any use. Thanks for the review! |
Ok, makes sense. So, you move the code out of |
Right. |
src/hotspot/share/opto/addnode.cpp
Outdated
set_req(2,x2); | ||
set_req(1,x1); | ||
} | ||
set_req_X(2,x2,phase); |
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.
Missing space after comma in argument list. Same a bit further down to.
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.
Thanks for the review. Should be fixed now.
/integrate |
@rwestrel Since your change was applied there have been 46 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 20297a1. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
hi, @rwestrel Is Node::set_req_X() same as PhaseIterGVN::replace_input_of()?
|
They are not quite the same as replace_input_of() has the rehash_node_delayed() call. When modifying an existing node, it's a requirement to call has_delete() which rehash_node_delayed() does for you. If you're in Ideal() modifying the "this" node, the hash_delete() call happened before the ideal call. So I guess roughly: in Ideal modifying this's input -> set_req_X(), otherwise replace_input_of() |
@rwestrel |
It's not uncommon for c2 to leave dead uses hanging from reachable
nodes. It's usually harmless but can cause confusion (such as in
valhalla JDK-8262289, not reproducible with non valhalla code AFAICT).
Most of the time, these are caused by calls to set_req() during igvn
that should be set_req_X() calls. I added a verification pass at the
end of optimization and fixed all the ones I found.
/cc hotspot-compiler
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/3012/head:pull/3012
$ git checkout pull/3012