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

src/share/vm/opto/lcm.cpp

Print this page
rev 5777 : 8027754: Enable loop optimizations for loops with MathExact inside


 455       continue;
 456 
 457     uint n_choice  = 2;
 458 
 459     // See if this instruction is consumed by a branch. If so, then (as the
 460     // branch is the last instruction in the basic block) force it to the
 461     // end of the basic block
 462     if ( must_clone[iop] ) {
 463       // See if any use is a branch
 464       bool found_machif = false;
 465 
 466       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
 467         Node* use = n->fast_out(j);
 468 
 469         // The use is a conditional branch, make them adjacent
 470         if (use->is_MachIf() && get_block_for_node(use) == block) {
 471           found_machif = true;
 472           break;
 473         }
 474 
 475         // For nodes that produce a FlagsProj, make the node adjacent to the
 476         // use of the FlagsProj
 477         if (use->is_FlagsProj() && get_block_for_node(use) == block) {
 478           found_machif = true;
 479           break;
 480         }
 481 
 482         // More than this instruction pending for successor to be ready,
 483         // don't choose this if other opportunities are ready
 484         if (ready_cnt.at(use->_idx) > 1)
 485           n_choice = 1;
 486       }
 487 
 488       // loop terminated, prefer not to use this instruction
 489       if (found_machif)
 490         continue;
 491     }
 492 
 493     // See if this has a predecessor that is "must_clone", i.e. sets the
 494     // condition code. If so, choose this first
 495     for (uint j = 0; j < n->req() ; j++) {
 496       Node *inn = n->in(j);
 497       if (inn) {
 498         if (inn->is_Mach() && must_clone[inn->as_Mach()->ideal_Opcode()] ) {
 499           n_choice = 3;
 500           break;
 501         }




 455       continue;
 456 
 457     uint n_choice  = 2;
 458 
 459     // See if this instruction is consumed by a branch. If so, then (as the
 460     // branch is the last instruction in the basic block) force it to the
 461     // end of the basic block
 462     if ( must_clone[iop] ) {
 463       // See if any use is a branch
 464       bool found_machif = false;
 465 
 466       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
 467         Node* use = n->fast_out(j);
 468 
 469         // The use is a conditional branch, make them adjacent
 470         if (use->is_MachIf() && get_block_for_node(use) == block) {
 471           found_machif = true;
 472           break;
 473         }
 474 







 475         // More than this instruction pending for successor to be ready,
 476         // don't choose this if other opportunities are ready
 477         if (ready_cnt.at(use->_idx) > 1)
 478           n_choice = 1;
 479       }
 480 
 481       // loop terminated, prefer not to use this instruction
 482       if (found_machif)
 483         continue;
 484     }
 485 
 486     // See if this has a predecessor that is "must_clone", i.e. sets the
 487     // condition code. If so, choose this first
 488     for (uint j = 0; j < n->req() ; j++) {
 489       Node *inn = n->in(j);
 490       if (inn) {
 491         if (inn->is_Mach() && must_clone[inn->as_Mach()->ideal_Opcode()] ) {
 492           n_choice = 3;
 493           break;
 494         }


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