src/share/vm/opto/loopnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/loopnode.cpp

Print this page
rev 10071 : 8147645: get_ctrl_no_update() code is wrong
Summary: Array.fill intrinsification code doesn't mark replaced control as dead
Reviewed-by:


 738   // Replace the old IfNode with a new LoopEndNode
 739   Node *lex = _igvn.register_new_node_with_optimizer(new CountedLoopEndNode( iff->in(0), test, cl_prob, iff->as_If()->_fcnt ));
 740   IfNode *le = lex->as_If();
 741   uint dd = dom_depth(iff);
 742   set_idom(le, le->in(0), dd); // Update dominance for loop exit
 743   set_loop(le, loop);
 744 
 745   // Get the loop-exit control
 746   Node *iffalse = iff->as_If()->proj_out(!(iftrue_op == Op_IfTrue));
 747 
 748   // Need to swap loop-exit and loop-back control?
 749   if (iftrue_op == Op_IfFalse) {
 750     Node *ift2=_igvn.register_new_node_with_optimizer(new IfTrueNode (le));
 751     Node *iff2=_igvn.register_new_node_with_optimizer(new IfFalseNode(le));
 752 
 753     loop->_tail = back_control = ift2;
 754     set_loop(ift2, loop);
 755     set_loop(iff2, get_loop(iffalse));
 756 
 757     // Lazy update of 'get_ctrl' mechanism.
 758     lazy_replace_proj( iffalse, iff2 );
 759     lazy_replace_proj( iftrue,  ift2 );
 760 
 761     // Swap names
 762     iffalse = iff2;
 763     iftrue  = ift2;
 764   } else {
 765     _igvn.rehash_node_delayed(iffalse);
 766     _igvn.rehash_node_delayed(iftrue);
 767     iffalse->set_req_X( 0, le, &_igvn );
 768     iftrue ->set_req_X( 0, le, &_igvn );
 769   }
 770 
 771   set_idom(iftrue,  le, dd+1);
 772   set_idom(iffalse, le, dd+1);
 773   assert(iff->outcnt() == 0, "should be dead now");
 774   lazy_replace( iff, le ); // fix 'get_ctrl'
 775 
 776   // Now setup a new CountedLoopNode to replace the existing LoopNode
 777   CountedLoopNode *l = new CountedLoopNode(init_control, back_control);
 778   l->set_unswitch_count(x->as_Loop()->unswitch_count()); // Preserve
 779   // The following assert is approximately true, and defines the intention




 738   // Replace the old IfNode with a new LoopEndNode
 739   Node *lex = _igvn.register_new_node_with_optimizer(new CountedLoopEndNode( iff->in(0), test, cl_prob, iff->as_If()->_fcnt ));
 740   IfNode *le = lex->as_If();
 741   uint dd = dom_depth(iff);
 742   set_idom(le, le->in(0), dd); // Update dominance for loop exit
 743   set_loop(le, loop);
 744 
 745   // Get the loop-exit control
 746   Node *iffalse = iff->as_If()->proj_out(!(iftrue_op == Op_IfTrue));
 747 
 748   // Need to swap loop-exit and loop-back control?
 749   if (iftrue_op == Op_IfFalse) {
 750     Node *ift2=_igvn.register_new_node_with_optimizer(new IfTrueNode (le));
 751     Node *iff2=_igvn.register_new_node_with_optimizer(new IfFalseNode(le));
 752 
 753     loop->_tail = back_control = ift2;
 754     set_loop(ift2, loop);
 755     set_loop(iff2, get_loop(iffalse));
 756 
 757     // Lazy update of 'get_ctrl' mechanism.
 758     lazy_replace(iffalse, iff2);
 759     lazy_replace(iftrue,  ift2);
 760 
 761     // Swap names
 762     iffalse = iff2;
 763     iftrue  = ift2;
 764   } else {
 765     _igvn.rehash_node_delayed(iffalse);
 766     _igvn.rehash_node_delayed(iftrue);
 767     iffalse->set_req_X( 0, le, &_igvn );
 768     iftrue ->set_req_X( 0, le, &_igvn );
 769   }
 770 
 771   set_idom(iftrue,  le, dd+1);
 772   set_idom(iffalse, le, dd+1);
 773   assert(iff->outcnt() == 0, "should be dead now");
 774   lazy_replace( iff, le ); // fix 'get_ctrl'
 775 
 776   // Now setup a new CountedLoopNode to replace the existing LoopNode
 777   CountedLoopNode *l = new CountedLoopNode(init_control, back_control);
 778   l->set_unswitch_count(x->as_Loop()->unswitch_count()); // Preserve
 779   // The following assert is approximately true, and defines the intention


src/share/vm/opto/loopnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File