Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8280696: C2 compilation hits assert(is_dominator(c, n_ctrl)) failed
Reviewed-by: kvn, chagedorn, roland
  • Loading branch information
TobiHartmann committed May 19, 2022
1 parent af7cda5 commit fa1b56e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/hotspot/share/opto/cfgnode.cpp
Expand Up @@ -2165,7 +2165,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) {
doit = false;
break;
}
if (in(i)->in(AddPNode::Offset) != base) {
if (in(i)->in(AddPNode::Base) != base) {
base = NULL;
}
if (in(i)->in(AddPNode::Offset) != offset) {
Expand Down
21 changes: 11 additions & 10 deletions src/hotspot/share/opto/loopopts.cpp
Expand Up @@ -333,9 +333,11 @@ Node *PhaseIdealLoop::has_local_phi_input( Node *n ) {
// We allow the special case of AddP's with no local inputs.
// This allows us to split-up address expressions.
if (m->is_AddP() &&
get_ctrl(m->in(2)) != n_ctrl &&
get_ctrl(m->in(3)) != n_ctrl) {
// Move the AddP up to dominating point
get_ctrl(m->in(AddPNode::Base)) != n_ctrl &&
get_ctrl(m->in(AddPNode::Address)) != n_ctrl &&
get_ctrl(m->in(AddPNode::Offset)) != n_ctrl) {
// Move the AddP up to the dominating point. That's fine because control of m's inputs
// must dominate get_ctrl(m) == n_ctrl and we just checked that the input controls are != n_ctrl.
Node* c = find_non_split_ctrl(idom(n_ctrl));
if (c->is_OuterStripMinedLoop()) {
c->as_Loop()->verify_strip_mined(1);
Expand Down Expand Up @@ -1703,6 +1705,8 @@ void PhaseIdealLoop::try_sink_out_of_loop(Node* n) {
}
}

// Compute the early control of a node by following its inputs until we reach
// nodes that are pinned. Then compute the LCA of the control of all pinned nodes.
Node* PhaseIdealLoop::compute_early_ctrl(Node* n, Node* n_ctrl) {
Node* early_ctrl = NULL;
ResourceMark rm;
Expand All @@ -1718,17 +1722,14 @@ Node* PhaseIdealLoop::compute_early_ctrl(Node* n, Node* n_ctrl) {
} else {
for (uint j = 0; j < m->req(); j++) {
Node* in = m->in(j);
if (in == NULL) {
continue;
if (in != NULL) {
wq.push(in);
}
wq.push(in);
}
}
if (c != NULL) {
assert(is_dominator(c, n_ctrl), "");
if (early_ctrl == NULL) {
early_ctrl = c;
} else if (is_dominator(early_ctrl, c)) {
assert(is_dominator(c, n_ctrl), "control input must dominate current control");
if (early_ctrl == NULL || is_dominator(early_ctrl, c)) {
early_ctrl = c;
}
}
Expand Down

3 comments on commit fa1b56e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on fa1b56e Jun 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on fa1b56e Jun 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch GoeLin-backport-fa1b56ed in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit fa1b56ed from the openjdk/jdk repository.

The commit being backported was authored by Tobias Hartmann on 19 May 2022 and was reviewed by Vladimir Kozlov, Christian Hagedorn and Roland Westrelin.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-fa1b56ed:GoeLin-backport-fa1b56ed
$ git checkout GoeLin-backport-fa1b56ed
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev GoeLin-backport-fa1b56ed

Please sign in to comment.