< prev index next >

src/share/vm/opto/loopUnswitch.cpp

Print this page




 357 
 358 bool CountedLoopReserveKit::create_reserve() {
 359   if (!_active) {
 360     return false;
 361   }
 362 
 363   if(!_lpt->_head->is_CountedLoop()) {
 364     if (TraceLoopOpts) {
 365       tty->print_cr("CountedLoopReserveKit::create_reserve: %d not counted loop", _lpt->_head->_idx);
 366     }
 367     return false;
 368   }
 369   CountedLoopNode *cl = _lpt->_head->as_CountedLoop();
 370   if (!cl->is_valid_counted_loop()) {
 371     if (TraceLoopOpts) {
 372       tty->print_cr("CountedLoopReserveKit::create_reserve: %d not valid counted loop", cl->_idx);
 373     }
 374     return false; // skip malformed counted loop
 375   }
 376   if (!cl->is_main_loop()) {






 377     if (TraceLoopOpts) {
 378       tty->print_cr("CountedLoopReserveKit::create_reserve: %d not main loop", cl->_idx);


 379     }
 380     return false; // skip normal, pre, and post loops
 381   }
 382 
 383   _lp = _lpt->_head->as_Loop();
 384   _lp_reserved = _phase->create_reserve_version_of_loop(_lpt, this);
 385 
 386   if (!_lp_reserved->is_CountedLoop()) {
 387     return false;
 388   }
 389 
 390   Node* ifslow_pred = _lp_reserved->as_CountedLoop()->in(LoopNode::EntryControl);
 391 
 392   if (!ifslow_pred->is_IfFalse()) {
 393     return false;
 394   }
 395 
 396   Node* iff = ifslow_pred->in(0);
 397   if (!iff->is_If() || iff != _iff) {
 398     return false;
 399   }
 400 


 357 
 358 bool CountedLoopReserveKit::create_reserve() {
 359   if (!_active) {
 360     return false;
 361   }
 362 
 363   if(!_lpt->_head->is_CountedLoop()) {
 364     if (TraceLoopOpts) {
 365       tty->print_cr("CountedLoopReserveKit::create_reserve: %d not counted loop", _lpt->_head->_idx);
 366     }
 367     return false;
 368   }
 369   CountedLoopNode *cl = _lpt->_head->as_CountedLoop();
 370   if (!cl->is_valid_counted_loop()) {
 371     if (TraceLoopOpts) {
 372       tty->print_cr("CountedLoopReserveKit::create_reserve: %d not valid counted loop", cl->_idx);
 373     }
 374     return false; // skip malformed counted loop
 375   }
 376   if (!cl->is_main_loop()) {
 377     bool loop_not_canonical = true;
 378     if (cl->is_post_loop() && (cl->slp_max_unroll() > 0)) {
 379       loop_not_canonical = false;
 380     }
 381     // only reject some loop forms
 382     if (loop_not_canonical) {
 383       if (TraceLoopOpts) {
 384         tty->print_cr("CountedLoopReserveKit::create_reserve: %d not canonical loop", cl->_idx);
 385       }
 386       return false; // skip normal, pre, and post (conditionally) loops
 387     }

 388   }
 389 
 390   _lp = _lpt->_head->as_Loop();
 391   _lp_reserved = _phase->create_reserve_version_of_loop(_lpt, this);
 392 
 393   if (!_lp_reserved->is_CountedLoop()) {
 394     return false;
 395   }
 396 
 397   Node* ifslow_pred = _lp_reserved->as_CountedLoop()->in(LoopNode::EntryControl);
 398 
 399   if (!ifslow_pred->is_IfFalse()) {
 400     return false;
 401   }
 402 
 403   Node* iff = ifslow_pred->in(0);
 404   if (!iff->is_If() || iff != _iff) {
 405     return false;
 406   }
 407 
< prev index next >