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 5902 : 8027754: Enable loop optimizations for loops with MathExact inside


 503       continue;
 504 
 505     uint n_choice  = 2;
 506 
 507     // See if this instruction is consumed by a branch. If so, then (as the
 508     // branch is the last instruction in the basic block) force it to the
 509     // end of the basic block
 510     if ( must_clone[iop] ) {
 511       // See if any use is a branch
 512       bool found_machif = false;
 513 
 514       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
 515         Node* use = n->fast_out(j);
 516 
 517         // The use is a conditional branch, make them adjacent
 518         if (use->is_MachIf() && get_block_for_node(use) == block) {
 519           found_machif = true;
 520           break;
 521         }
 522 
 523         // For nodes that produce a FlagsProj, make the node adjacent to the
 524         // use of the FlagsProj
 525         if (use->is_FlagsProj() && get_block_for_node(use) == block) {
 526           found_machif = true;
 527           break;
 528         }
 529 
 530         // More than this instruction pending for successor to be ready,
 531         // don't choose this if other opportunities are ready
 532         if (ready_cnt.at(use->_idx) > 1)
 533           n_choice = 1;
 534       }
 535 
 536       // loop terminated, prefer not to use this instruction
 537       if (found_machif)
 538         continue;
 539     }
 540 
 541     // See if this has a predecessor that is "must_clone", i.e. sets the
 542     // condition code. If so, choose this first
 543     for (uint j = 0; j < n->req() ; j++) {
 544       Node *inn = n->in(j);
 545       if (inn) {
 546         if (inn->is_Mach() && must_clone[inn->as_Mach()->ideal_Opcode()] ) {
 547           n_choice = 3;
 548           break;
 549         }




 503       continue;
 504 
 505     uint n_choice  = 2;
 506 
 507     // See if this instruction is consumed by a branch. If so, then (as the
 508     // branch is the last instruction in the basic block) force it to the
 509     // end of the basic block
 510     if ( must_clone[iop] ) {
 511       // See if any use is a branch
 512       bool found_machif = false;
 513 
 514       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
 515         Node* use = n->fast_out(j);
 516 
 517         // The use is a conditional branch, make them adjacent
 518         if (use->is_MachIf() && get_block_for_node(use) == block) {
 519           found_machif = true;
 520           break;
 521         }
 522 







 523         // More than this instruction pending for successor to be ready,
 524         // don't choose this if other opportunities are ready
 525         if (ready_cnt.at(use->_idx) > 1)
 526           n_choice = 1;
 527       }
 528 
 529       // loop terminated, prefer not to use this instruction
 530       if (found_machif)
 531         continue;
 532     }
 533 
 534     // See if this has a predecessor that is "must_clone", i.e. sets the
 535     // condition code. If so, choose this first
 536     for (uint j = 0; j < n->req() ; j++) {
 537       Node *inn = n->in(j);
 538       if (inn) {
 539         if (inn->is_Mach() && must_clone[inn->as_Mach()->ideal_Opcode()] ) {
 540           n_choice = 3;
 541           break;
 542         }


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