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
Backport-of: fa1b56ede6eed653f70efbbfff3af5ee6b481ee4
  • Loading branch information
GoeLin committed Jun 24, 2022
1 parent 3269cec commit dd7ab3d
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 @@ -2131,7 +2131,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 @@ -334,9 +334,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 @@ -1603,6 +1605,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 @@ -1618,17 +1622,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

1 comment on commit dd7ab3d

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.