569 if( cnt == 0 && !can_reshape) { // Parse phase - leave the node as it is. |
569 if( cnt == 0 && !can_reshape) { // Parse phase - leave the node as it is. |
570 // No inputs or all inputs are NULL. |
570 // No inputs or all inputs are NULL. |
571 return NULL; |
571 return NULL; |
572 } else if (can_reshape) { // Optimization phase - remove the node |
572 } else if (can_reshape) { // Optimization phase - remove the node |
573 PhaseIterGVN *igvn = phase->is_IterGVN(); |
573 PhaseIterGVN *igvn = phase->is_IterGVN(); |
|
574 // Strip mined (inner) loop is going away, remove outer loop. |
|
575 if (is_CountedLoop() && |
|
576 as_Loop()->is_strip_mined()) { |
|
577 Node* outer_sfpt = as_CountedLoop()->outer_safepoint(); |
|
578 Node* outer_out = as_CountedLoop()->outer_loop_exit(); |
|
579 if (outer_sfpt != NULL && outer_out != NULL) { |
|
580 Node* in = outer_sfpt->in(0); |
|
581 igvn->replace_node(outer_out, in); |
|
582 LoopNode* outer = as_CountedLoop()->outer_loop(); |
|
583 igvn->replace_input_of(outer, LoopNode::LoopBackControl, igvn->C->top()); |
|
584 } |
|
585 } |
574 Node *parent_ctrl; |
586 Node *parent_ctrl; |
575 if( cnt == 0 ) { |
587 if( cnt == 0 ) { |
576 assert( req() == 1, "no inputs expected" ); |
588 assert( req() == 1, "no inputs expected" ); |
577 // During IGVN phase such region will be subsumed by TOP node |
589 // During IGVN phase such region will be subsumed by TOP node |
578 // so region's phis will have TOP as control node. |
590 // so region's phis will have TOP as control node. |