1150 igvn.register_new_node_with_optimizer(landing_pad, _head);
1151 // Insert landing pad into the header
1152 _head->add_req(landing_pad);
1153 }
1154
1155 //------------------------------split_outer_loop-------------------------------
1156 // Split out the outermost loop from this shared header.
1157 void IdealLoopTree::split_outer_loop( PhaseIdealLoop *phase ) {
1158 PhaseIterGVN &igvn = phase->_igvn;
1159
1160 // Find index of outermost loop; it should also be my tail.
1161 uint outer_idx = 1;
1162 while( _head->in(outer_idx) != _tail ) outer_idx++;
1163
1164 // Make a LoopNode for the outermost loop.
1165 Node *ctl = _head->in(LoopNode::EntryControl);
1166 Node *outer = new (phase->C, 3) LoopNode( ctl, _head->in(outer_idx) );
1167 outer = igvn.register_new_node_with_optimizer(outer, _head);
1168 phase->set_created_loop_node();
1169
1170 Node* pred = phase->clone_loop_predicates(ctl, outer, true);
1171 // Outermost loop falls into '_head' loop
1172 _head->set_req(LoopNode::EntryControl, pred);
1173 _head->del_req(outer_idx);
1174 // Split all the Phis up between '_head' loop and 'outer' loop.
1175 for (DUIterator_Fast jmax, j = _head->fast_outs(jmax); j < jmax; j++) {
1176 Node *out = _head->fast_out(j);
1177 if( out->is_Phi() ) {
1178 PhiNode *old_phi = out->as_Phi();
1179 assert( old_phi->region() == _head, "" );
1180 Node *phi = PhiNode::make_blank(outer, old_phi);
1181 phi->init_req(LoopNode::EntryControl, old_phi->in(LoopNode::EntryControl));
1182 phi->init_req(LoopNode::LoopBackControl, old_phi->in(outer_idx));
1183 phi = igvn.register_new_node_with_optimizer(phi, old_phi);
1184 // Make old Phi point to new Phi on the fall-in path
1185 igvn.hash_delete(old_phi);
1186 old_phi->set_req(LoopNode::EntryControl, phi);
1187 old_phi->del_req(outer_idx);
1188 igvn._worklist.push(old_phi);
1189 }
1190 }
1191
1192 // Use the new loop head instead of the old shared one
|
1150 igvn.register_new_node_with_optimizer(landing_pad, _head);
1151 // Insert landing pad into the header
1152 _head->add_req(landing_pad);
1153 }
1154
1155 //------------------------------split_outer_loop-------------------------------
1156 // Split out the outermost loop from this shared header.
1157 void IdealLoopTree::split_outer_loop( PhaseIdealLoop *phase ) {
1158 PhaseIterGVN &igvn = phase->_igvn;
1159
1160 // Find index of outermost loop; it should also be my tail.
1161 uint outer_idx = 1;
1162 while( _head->in(outer_idx) != _tail ) outer_idx++;
1163
1164 // Make a LoopNode for the outermost loop.
1165 Node *ctl = _head->in(LoopNode::EntryControl);
1166 Node *outer = new (phase->C, 3) LoopNode( ctl, _head->in(outer_idx) );
1167 outer = igvn.register_new_node_with_optimizer(outer, _head);
1168 phase->set_created_loop_node();
1169
1170 // Outermost loop falls into '_head' loop
1171 _head->set_req(LoopNode::EntryControl, outer);
1172 _head->del_req(outer_idx);
1173 // Split all the Phis up between '_head' loop and 'outer' loop.
1174 for (DUIterator_Fast jmax, j = _head->fast_outs(jmax); j < jmax; j++) {
1175 Node *out = _head->fast_out(j);
1176 if( out->is_Phi() ) {
1177 PhiNode *old_phi = out->as_Phi();
1178 assert( old_phi->region() == _head, "" );
1179 Node *phi = PhiNode::make_blank(outer, old_phi);
1180 phi->init_req(LoopNode::EntryControl, old_phi->in(LoopNode::EntryControl));
1181 phi->init_req(LoopNode::LoopBackControl, old_phi->in(outer_idx));
1182 phi = igvn.register_new_node_with_optimizer(phi, old_phi);
1183 // Make old Phi point to new Phi on the fall-in path
1184 igvn.hash_delete(old_phi);
1185 old_phi->set_req(LoopNode::EntryControl, phi);
1186 old_phi->del_req(outer_idx);
1187 igvn._worklist.push(old_phi);
1188 }
1189 }
1190
1191 // Use the new loop head instead of the old shared one
|