-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8253524: C2: Refactor code that clones predicates during loop unswitching #317
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
Conversation
👋 Welcome back roland! A progress list of the required criteria for merging this PR into |
@rwestrel 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 |
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.
Very nice clean-up! This makes it much easier. Apart from some minor code style comments, it looks good to me!
ProjNode* new_predicate_proj, bool is_slow_loop, uint idx_before_clone, | ||
Node_List &old_new) { | ||
assert(old_predicate_proj->is_Proj(), "must be projection"); | ||
void PhaseIdealLoop::clone_skeleton_predicates_to_unswitched_loop(IdealLoopTree *loop, const Node_List &old_new, Deoptimization::DeoptReason reason, |
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.
Asterisk: IdealLoopTree*
src/hotspot/share/opto/loopnode.hpp
Outdated
void clone_predicates_to_unswitched_loop(IdealLoopTree *loop, const Node_List &old_new, ProjNode*& iffast, ProjNode*& ifslow); | ||
ProjNode* clone_predicate_to_unswitched_loop(ProjNode* predicate_proj, Node* new_entry, Deoptimization::DeoptReason reason); | ||
void clone_skeleton_predicates_to_unswitched_loop(IdealLoopTree *loop, const Node_List &old_new, Deoptimization::DeoptReason reason, | ||
ProjNode* old_predicate_proj, ProjNode* iffast, ProjNode* ifslow); | ||
void check_created_predicate_for_unswitching(const Node *new_entry) const PRODUCT_RETURN; |
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.
Move the asterisks to the types.
} | ||
|
||
#ifndef PRODUCT | ||
void PhaseIdealLoop::check_created_predicate_for_unswitching(const Node *new_entry) const { |
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.
Asterisk: Node*
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.
@chhagedorn thanks for the review (and offline comments). Should be fixed now.
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!
@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 more 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 13 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 |
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.
} | ||
#endif | ||
void PhaseIdealLoop::clone_predicates_to_unswitched_loop(IdealLoopTree* loop, const Node_List& old_new, ProjNode*& iffast, ProjNode*& ifslow) { | ||
LoopNode* head = loop->_head->as_Loop(); |
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.
Extra whitespace after head
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'll remove the white space before I integrate the change.
@chhagedorn @vnkozlov @TobiHartmann thanks for the review |
/test |
@rwestrel you need to get approval to run the tests in tier1 for commits up until 93f33e9b |
/test approve |
A test job has been started with id: github.com-149121954-317-698149552 |
@rwestrel your test job with id github.com-149121954-317-698149552 for commits up until 93f33e9b has finished. |
93f33e9
to
33fb2fe
Compare
/test |
/test approve |
A test job has been started with id: github.com-149121954-317-698199487 |
/integrate |
@rwestrel Since your change was applied there have been 13 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit b1e2f02. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
During unswitching, PhaseIdealLoop::create_slow_version_of_loop()
calls PhaseIdealLoop::clone_predicates_to_unswitched_loop() twice, one
for each loops, to clone some predicates above each loop. That code is
fragile as it (implicitly) requires the fast loop to be processed
first. I propose calling
PhaseIdealLoop::clone_predicates_to_unswitched_loop() a single time
and have it handle both loops in a single pass.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/317/head:pull/317
$ git checkout pull/317