Skip to content

Commit fa1b56e

Browse files
committed
8280696: C2 compilation hits assert(is_dominator(c, n_ctrl)) failed
Reviewed-by: kvn, chagedorn, roland
1 parent af7cda5 commit fa1b56e

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/hotspot/share/opto/cfgnode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) {
21652165
doit = false;
21662166
break;
21672167
}
2168-
if (in(i)->in(AddPNode::Offset) != base) {
2168+
if (in(i)->in(AddPNode::Base) != base) {
21692169
base = NULL;
21702170
}
21712171
if (in(i)->in(AddPNode::Offset) != offset) {

src/hotspot/share/opto/loopopts.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,11 @@ Node *PhaseIdealLoop::has_local_phi_input( Node *n ) {
333333
// We allow the special case of AddP's with no local inputs.
334334
// This allows us to split-up address expressions.
335335
if (m->is_AddP() &&
336-
get_ctrl(m->in(2)) != n_ctrl &&
337-
get_ctrl(m->in(3)) != n_ctrl) {
338-
// Move the AddP up to dominating point
336+
get_ctrl(m->in(AddPNode::Base)) != n_ctrl &&
337+
get_ctrl(m->in(AddPNode::Address)) != n_ctrl &&
338+
get_ctrl(m->in(AddPNode::Offset)) != n_ctrl) {
339+
// Move the AddP up to the dominating point. That's fine because control of m's inputs
340+
// must dominate get_ctrl(m) == n_ctrl and we just checked that the input controls are != n_ctrl.
339341
Node* c = find_non_split_ctrl(idom(n_ctrl));
340342
if (c->is_OuterStripMinedLoop()) {
341343
c->as_Loop()->verify_strip_mined(1);
@@ -1703,6 +1705,8 @@ void PhaseIdealLoop::try_sink_out_of_loop(Node* n) {
17031705
}
17041706
}
17051707

1708+
// Compute the early control of a node by following its inputs until we reach
1709+
// nodes that are pinned. Then compute the LCA of the control of all pinned nodes.
17061710
Node* PhaseIdealLoop::compute_early_ctrl(Node* n, Node* n_ctrl) {
17071711
Node* early_ctrl = NULL;
17081712
ResourceMark rm;
@@ -1718,17 +1722,14 @@ Node* PhaseIdealLoop::compute_early_ctrl(Node* n, Node* n_ctrl) {
17181722
} else {
17191723
for (uint j = 0; j < m->req(); j++) {
17201724
Node* in = m->in(j);
1721-
if (in == NULL) {
1722-
continue;
1725+
if (in != NULL) {
1726+
wq.push(in);
17231727
}
1724-
wq.push(in);
17251728
}
17261729
}
17271730
if (c != NULL) {
1728-
assert(is_dominator(c, n_ctrl), "");
1729-
if (early_ctrl == NULL) {
1730-
early_ctrl = c;
1731-
} else if (is_dominator(early_ctrl, c)) {
1731+
assert(is_dominator(c, n_ctrl), "control input must dominate current control");
1732+
if (early_ctrl == NULL || is_dominator(early_ctrl, c)) {
17321733
early_ctrl = c;
17331734
}
17341735
}

0 commit comments

Comments
 (0)