-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8344035: Replace predicate walking code in Loop Unswitching with a predicate visitor #22828
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back chagedorn! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@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. |
const int opcode, const bool rewire_uncommon_proj_phi_inputs, | ||
AssertionPredicateType assertion_predicate_type) { | ||
const int opcode, const bool rewire_uncommon_proj_phi_inputs) { |
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.
Squeezed this in here: assertion_predicate_type
is dead.
void PhaseIdealLoop::get_opaque_template_assertion_predicate_nodes(ParsePredicateSuccessProj* parse_predicate_proj, | ||
Unique_Node_List& list) { |
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.
Only applied a renaming here.
void unswitch(const UnswitchedLoopSelector& unswitched_loop_selector) { | ||
const uint first_false_path_loop_node_index = _phase->C->unique(); | ||
clone_loop(unswitched_loop_selector); | ||
|
||
move_parse_and_template_assertion_predicates_to_unswitched_loops(unswitched_loop_selector, | ||
first_false_path_loop_node_index); | ||
DEBUG_ONLY(verify_unswitched_loop_versions(_loop->_head->as_Loop(), unswitched_loop_selector);) | ||
|
||
_phase->recompute_dom_depth(); | ||
remove_unswitch_candidate_from_loops(unswitched_loop_selector); |
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.
New order of operation (see PR description).
const UnswitchedLoopSelector& unswitched_loop_selector, const uint first_false_path_loop_node_index) const { | ||
const NodeInOriginalLoopBody node_in_true_path_loop_body(first_false_path_loop_node_index, _old_new); | ||
const NodeInClonedLoopBody node_in_false_path_loop_body(first_false_path_loop_node_index); | ||
CloneUnswitchedLoopPredicatesVisitor | ||
clone_unswitched_loop_predicates_visitor(_loop_head, old_to_new(_loop_head)->as_Loop(), node_in_true_path_loop_body, | ||
node_in_false_path_loop_body, _phase); | ||
Node* source_loop_entry = unswitched_loop_selector.selector()->in(0); | ||
PredicateIterator predicate_iterator(source_loop_entry); | ||
predicate_iterator.for_each(clone_unswitched_loop_predicates_visitor); |
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.
The main part that is new here: We use visitors to clone the predicates and rewire them correctly.
Node* old_to_new(const Node* old) const { | ||
return _old_new[old->_idx]; | ||
} |
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.
Only moved.
This patch is a follow up to the clean-ups done with JDK-8342945 and introduces a new predicate visitor for Loop Unswitching to update the last remaining custom predicate cloning code.
This patch includes the following:
New
CloneUnswitchedLoopPredicatesVisitor
class which delegates the cloning work to a newClonePredicateToTargetLoop
class.PredicateIterator
and call theCloneUnswitchedLoopPredicatesVisitor
for each visited predicate. Then we clone the predicate on the fly to the target loop.New
ClonePredicateToTargetLoop
class:TargetLoopPredicateChain
class:TargetLoopPredicateChain
.CreateAssertionPredicatesVisitor
which is done when we tackle the actual still remaining Assertion Predicate bugs.Removal of custom predicate cloning code found in
PhaseIdealLoop
.Changed steps performed in Loop Unswitching from:
to:
Rename/update
get_template_assertion_predicates()
/TemplateAssertionPredicateCollector
to reflect the only use left.Thanks,
Christian
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22828/head:pull/22828
$ git checkout pull/22828
Update a local copy of the PR:
$ git checkout pull/22828
$ git pull https://git.openjdk.org/jdk.git pull/22828/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22828
View PR using the GUI difftool:
$ git pr show -t 22828
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22828.diff
Using Webrev
Link to Webrev Comment