@@ -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.
17061710Node* 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