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

src/share/vm/opto/loopTransform.cpp

Print this page




2040     register_new_node(add,ctrl);
2041     Node *div = new DivINode(0,add,stride);
2042     register_new_node(div,ctrl);
2043     Node *mul = new MulINode(div,stride);
2044     register_new_node(mul,ctrl);
2045     Node *newlim = new AddINode(mul,init);
2046     register_new_node(newlim,ctrl);
2047     main_limit = newlim;
2048   }
2049 
2050   Node *main_cle = cl->loopexit();
2051   Node *main_bol = main_cle->in(1);
2052   // Hacking loop bounds; need private copies of exit test
2053   if( main_bol->outcnt() > 1 ) {// BoolNode shared?
2054     main_bol = main_bol->clone();// Clone a private BoolNode
2055     register_new_node( main_bol, main_cle->in(0) );
2056     _igvn.replace_input_of(main_cle, 1, main_bol);
2057   }
2058   Node *main_cmp = main_bol->in(1);
2059   if( main_cmp->outcnt() > 1 ) { // CmpNode shared?
2060     _igvn.hash_delete(main_bol);
2061     main_cmp = main_cmp->clone();// Clone a private CmpNode
2062     register_new_node( main_cmp, main_cle->in(0) );
2063     main_bol->set_req(1,main_cmp);
2064   }
2065   // Hack the now-private loop bounds
2066   _igvn.replace_input_of(main_cmp, 2, main_limit);
2067   // The OpaqueNode is unshared by design
2068   assert( opqzm->outcnt() == 1, "cannot hack shared node" );
2069   _igvn.replace_input_of(opqzm, 1, main_limit);
2070 }
2071 
2072 //------------------------------DCE_loop_body----------------------------------
2073 // Remove simplistic dead code from loop body
2074 void IdealLoopTree::DCE_loop_body() {
2075   for( uint i = 0; i < _body.size(); i++ )
2076     if( _body.at(i)->outcnt() == 0 )
2077       _body.map( i--, _body.pop() );
2078 }
2079 
2080 
2081 //------------------------------adjust_loop_exit_prob--------------------------
2082 // Look for loop-exit tests with the 50/50 (or worse) guesses from the parsing stage.
2083 // Replace with a 1-in-10 exit guess.




2040     register_new_node(add,ctrl);
2041     Node *div = new DivINode(0,add,stride);
2042     register_new_node(div,ctrl);
2043     Node *mul = new MulINode(div,stride);
2044     register_new_node(mul,ctrl);
2045     Node *newlim = new AddINode(mul,init);
2046     register_new_node(newlim,ctrl);
2047     main_limit = newlim;
2048   }
2049 
2050   Node *main_cle = cl->loopexit();
2051   Node *main_bol = main_cle->in(1);
2052   // Hacking loop bounds; need private copies of exit test
2053   if( main_bol->outcnt() > 1 ) {// BoolNode shared?
2054     main_bol = main_bol->clone();// Clone a private BoolNode
2055     register_new_node( main_bol, main_cle->in(0) );
2056     _igvn.replace_input_of(main_cle, 1, main_bol);
2057   }
2058   Node *main_cmp = main_bol->in(1);
2059   if( main_cmp->outcnt() > 1 ) { // CmpNode shared?

2060     main_cmp = main_cmp->clone();// Clone a private CmpNode
2061     register_new_node( main_cmp, main_cle->in(0) );
2062     _igvn.replace_input_of(main_bol, 1, main_cmp);
2063   }
2064   // Hack the now-private loop bounds
2065   _igvn.replace_input_of(main_cmp, 2, main_limit);
2066   // The OpaqueNode is unshared by design
2067   assert( opqzm->outcnt() == 1, "cannot hack shared node" );
2068   _igvn.replace_input_of(opqzm, 1, main_limit);
2069 }
2070 
2071 //------------------------------DCE_loop_body----------------------------------
2072 // Remove simplistic dead code from loop body
2073 void IdealLoopTree::DCE_loop_body() {
2074   for( uint i = 0; i < _body.size(); i++ )
2075     if( _body.at(i)->outcnt() == 0 )
2076       _body.map( i--, _body.pop() );
2077 }
2078 
2079 
2080 //------------------------------adjust_loop_exit_prob--------------------------
2081 // Look for loop-exit tests with the 50/50 (or worse) guesses from the parsing stage.
2082 // Replace with a 1-in-10 exit guess.


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