< prev index next >

src/hotspot/share/opto/split_if.cpp

Print this page




 222     n->dump();
 223   }
 224 #endif
 225 
 226   // ConvI2L may have type information on it which becomes invalid if
 227   // it moves up in the graph so change any clones so widen the type
 228   // to TypeLong::INT when pushing it up.
 229   const Type* rtype = NULL;
 230   if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::INT) {
 231     rtype = TypeLong::INT;
 232   }
 233 
 234   // Now actually split-up this guy.  One copy per control path merging.
 235   Node *phi = PhiNode::make_blank(blk1, n);
 236   for( uint j = 1; j < blk1->req(); j++ ) {
 237     Node *x = n->clone();
 238     // Widen the type of the ConvI2L when pushing up.
 239     if (rtype != NULL) x->as_Type()->set_type(rtype);
 240     if( n->in(0) && n->in(0) == blk1 )
 241       x->set_req( 0, blk1->in(j) );
 242     for( uint i = 1; i < n->req(); i++ ) {
 243       Node *m = n->in(i);
 244       if( get_ctrl(m) == blk1 ) {
 245         assert( m->in(0) == blk1, "" );
 246         x->set_req( i, m->in(j) );
 247       }
 248     }
 249     register_new_node( x, blk1->in(j) );
 250     phi->init_req( j, x );
 251   }
 252   // Announce phi to optimizer
 253   register_new_node(phi, blk1);
 254 
 255   // Remove cloned-up value from optimizer; use phi instead

 256   _igvn.replace_node( n, phi );
 257 
 258   // (There used to be a self-recursive call to split_up() here,
 259   // but it is not needed.  All necessary forward walking is done
 260   // by do_split_if() below.)
 261 
 262   return true;
 263 }
 264 
 265 //------------------------------register_new_node------------------------------
 266 void PhaseIdealLoop::register_new_node( Node *n, Node *blk ) {
 267   assert(!n->is_CFG(), "must be data node");
 268   _igvn.register_new_node_with_optimizer(n);
 269   set_ctrl(n, blk);
 270   IdealLoopTree *loop = get_loop(blk);
 271   if( !loop->_child )
 272     loop->_body.push(n);
 273 }
 274 
 275 //------------------------------small_cache------------------------------------




 222     n->dump();
 223   }
 224 #endif
 225 
 226   // ConvI2L may have type information on it which becomes invalid if
 227   // it moves up in the graph so change any clones so widen the type
 228   // to TypeLong::INT when pushing it up.
 229   const Type* rtype = NULL;
 230   if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::INT) {
 231     rtype = TypeLong::INT;
 232   }
 233 
 234   // Now actually split-up this guy.  One copy per control path merging.
 235   Node *phi = PhiNode::make_blank(blk1, n);
 236   for( uint j = 1; j < blk1->req(); j++ ) {
 237     Node *x = n->clone();
 238     // Widen the type of the ConvI2L when pushing up.
 239     if (rtype != NULL) x->as_Type()->set_type(rtype);
 240     if( n->in(0) && n->in(0) == blk1 )
 241       x->set_req( 0, blk1->in(j) );
 242     for( uint i = n->is_Proj() ? 0 : 1; i < n->req(); i++ ) {
 243       Node *m = n->in(i);
 244       if( get_ctrl(m) == blk1 ) {
 245         assert( m->in(0) == blk1, "" );
 246         x->set_req( i, m->in(j) );
 247       }
 248     }
 249     register_new_node( x, blk1->in(j) );
 250     phi->init_req( j, x );
 251   }
 252   // Announce phi to optimizer
 253   register_new_node(phi, blk1);
 254 
 255   // Remove cloned-up value from optimizer; use phi instead
 256   split_mem_thru_phi(n, blk1, phi);
 257   _igvn.replace_node( n, phi );
 258 
 259   // (There used to be a self-recursive call to split_up() here,
 260   // but it is not needed.  All necessary forward walking is done
 261   // by do_split_if() below.)
 262 
 263   return true;
 264 }
 265 
 266 //------------------------------register_new_node------------------------------
 267 void PhaseIdealLoop::register_new_node( Node *n, Node *blk ) {
 268   assert(!n->is_CFG(), "must be data node");
 269   _igvn.register_new_node_with_optimizer(n);
 270   set_ctrl(n, blk);
 271   IdealLoopTree *loop = get_loop(blk);
 272   if( !loop->_child )
 273     loop->_body.push(n);
 274 }
 275 
 276 //------------------------------small_cache------------------------------------


< prev index next >