# HG changeset patch # User neliasso # Date 1526374673 -7200 # Tue May 15 10:57:53 2018 +0200 # Node ID f288c56b82b7d64fd4c4c181d60a5161cf876934 # Parent ea54197f4fe40a5050b2e092e098927f2b8af9db 8203215: IdealLoopTree::split_outer_loop leaves phi-nodes with only one input Summary: Make sure the phis are transformed Reviewed-by: diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -1803,6 +1803,7 @@ // 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); } } @@ -2036,7 +2037,6 @@ 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) ); @@ -2714,11 +2714,16 @@ 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;