< prev index next >

src/hotspot/share/opto/loopnode.cpp

Print this page
rev 50110 : 8203215: IdealLoopTree::split_outer_loop leaves phi-nodes with only one input
Summary: Make sure the phis are transformed
Reviewed-by:

@@ -1801,10 +1801,11 @@
       phi->init_req(LoopNode::LoopBackControl, old_phi->in(outer_idx));
       phi = igvn.register_new_node_with_optimizer(phi, old_phi);
       // Make old Phi point to new Phi on the fall-in path
       igvn.replace_input_of(old_phi, LoopNode::EntryControl, phi);
       old_phi->del_req(outer_idx);
+      igvn.rehash_node_delayed(old_phi);
     }
   }
 
   // Use the new loop head instead of the old shared one
   _head = outer;

@@ -2034,11 +2035,10 @@
   // If I have one hot backedge, peel off myself loop.
   // I better be the outermost loop.
   if (_head->req() > 3 && !_irreducible) {
     split_outer_loop( phase );
     result = true;
-
   } else if (!_head->is_Loop() && !_irreducible) {
     // Make a new LoopNode to replace the old loop head
     Node *l = new LoopNode( _head->in(1), _head->in(2) );
     l = igvn.register_new_node_with_optimizer(l, _head);
     phase->set_created_loop_node();

@@ -2712,15 +2712,20 @@
   // Split shared headers and insert loop landing pads.
   // Do not bother doing this on the Root loop of course.
   if( !_verify_me && !_verify_only && _ltree_root->_child ) {
     C->print_method(PHASE_BEFORE_BEAUTIFY_LOOPS, 3);
     if( _ltree_root->_child->beautify_loops( this ) ) {
+      // IdealLoopTree::split_outer_loop may produce phi-nodes with a single in edge.
+      // Transform them away.
+      _igvn.optimize();
+
       // Re-build loop tree!
       _ltree_root->_child = NULL;
       _nodes.clear();
       reallocate_preorders();
       build_loop_tree();
+
       // Check for bailout, and return
       if (C->failing()) {
         return;
       }
       // Reset loop nesting depth
< prev index next >