1.1 --- a/src/share/vm/opto/loopnode.cpp Tue Apr 29 12:20:53 2014 -0700 1.2 +++ b/src/share/vm/opto/loopnode.cpp Fri May 02 16:44:54 2014 -0700 1.3 @@ -266,9 +266,9 @@ 1.4 1.5 // Counted loop head must be a good RegionNode with only 3 not NULL 1.6 // control input edges: Self, Entry, LoopBack. 1.7 - if (x->in(LoopNode::Self) == NULL || x->req() != 3) 1.8 + if (x->in(LoopNode::Self) == NULL || x->req() != 3 || loop->_irreducible) { 1.9 return false; 1.10 - 1.11 + } 1.12 Node *init_control = x->in(LoopNode::EntryControl); 1.13 Node *back_control = x->in(LoopNode::LoopBackControl); 1.14 if (init_control == NULL || back_control == NULL) // Partially dead 1.15 @@ -1522,11 +1522,11 @@ 1.16 1.17 // If I have one hot backedge, peel off myself loop. 1.18 // I better be the outermost loop. 1.19 - if( _head->req() > 3 ) { 1.20 + if (_head->req() > 3 && !_irreducible) { 1.21 split_outer_loop( phase ); 1.22 result = true; 1.23 1.24 - } else if( !_head->is_Loop() && !_irreducible ) { 1.25 + } else if (!_head->is_Loop() && !_irreducible) { 1.26 // Make a new LoopNode to replace the old loop head 1.27 Node *l = new (phase->C) LoopNode( _head->in(1), _head->in(2) ); 1.28 l = igvn.register_new_node_with_optimizer(l, _head); 1.29 @@ -2938,6 +2938,7 @@ 1.30 return pre_order; 1.31 } 1.32 } 1.33 + C->set_has_irreducible_loop(_has_irreducible_loops); 1.34 } 1.35 1.36 // This Node might be a decision point for loops. It is only if