hotspot/src/share/vm/opto/loopTransform.cpp
changeset 34174 4db2fb26dc49
parent 34164 a9e6034d7707
child 35139 071b000357fc
equal deleted inserted replaced
34173:01bb07d23a5b 34174:4db2fb26dc49
   790     if (xors_in_loop >= 4 && body_size < (uint)LoopUnrollLimit*4) return true;
   790     if (xors_in_loop >= 4 && body_size < (uint)LoopUnrollLimit*4) return true;
   791     // Normal case: loop too big
   791     // Normal case: loop too big
   792     return false;
   792     return false;
   793   }
   793   }
   794 
   794 
   795   if(cl->do_unroll_only()) {
   795   if (cl->do_unroll_only()) {
   796     NOT_PRODUCT(if (TraceSuperWordLoopUnrollAnalysis) tty->print_cr("policy_unroll passed vector loop(vlen=%d,factor = %d)\n", slp_max_unroll_factor, future_unroll_ct));
   796     if (TraceSuperWordLoopUnrollAnalysis) {
       
   797       tty->print_cr("policy_unroll passed vector loop(vlen=%d,factor = %d)\n", slp_max_unroll_factor, future_unroll_ct);
       
   798     }
   797   }
   799   }
   798 
   800 
   799   // Unroll once!  (Each trip will soon do double iterations)
   801   // Unroll once!  (Each trip will soon do double iterations)
   800   return true;
   802   return true;
   801 }
   803 }
   816     if (cl->has_passed_slp()) {
   818     if (cl->has_passed_slp()) {
   817       int slp_max_unroll_factor = cl->slp_max_unroll();
   819       int slp_max_unroll_factor = cl->slp_max_unroll();
   818       if (slp_max_unroll_factor >= future_unroll_ct) {
   820       if (slp_max_unroll_factor >= future_unroll_ct) {
   819         int new_limit = cl->node_count_before_unroll() * slp_max_unroll_factor;
   821         int new_limit = cl->node_count_before_unroll() * slp_max_unroll_factor;
   820         if (new_limit > LoopUnrollLimit) {
   822         if (new_limit > LoopUnrollLimit) {
   821           NOT_PRODUCT(if (TraceSuperWordLoopUnrollAnalysis) tty->print_cr("slp analysis unroll=%d, default limit=%d\n", new_limit, _local_loop_unroll_limit));
   823           if (TraceSuperWordLoopUnrollAnalysis) {
       
   824             tty->print_cr("slp analysis unroll=%d, default limit=%d\n", new_limit, _local_loop_unroll_limit);
       
   825           }
   822           _local_loop_unroll_limit = new_limit;
   826           _local_loop_unroll_limit = new_limit;
   823         }
   827         }
   824       }
   828       }
   825     }
   829     }
   826   }
   830   }
  2118           if (!conditional_rc) {
  2122           if (!conditional_rc) {
  2119             // (0-offset)/scale could be outside of loop iterations range.
  2123             // (0-offset)/scale could be outside of loop iterations range.
  2120             conditional_rc = !loop->dominates_backedge(iff) || RangeLimitCheck;
  2124             conditional_rc = !loop->dominates_backedge(iff) || RangeLimitCheck;
  2121           }
  2125           }
  2122         } else {
  2126         } else {
  2123 #ifndef PRODUCT
  2127           if (PrintOpto) {
  2124           if( PrintOpto )
       
  2125             tty->print_cr("missed RCE opportunity");
  2128             tty->print_cr("missed RCE opportunity");
  2126 #endif
  2129           }
  2127           continue;             // In release mode, ignore it
  2130           continue;             // In release mode, ignore it
  2128         }
  2131         }
  2129       } else {                  // Otherwise work on normal compares
  2132       } else {                  // Otherwise work on normal compares
  2130         switch( b_test._test ) {
  2133         switch( b_test._test ) {
  2131         case BoolTest::gt:
  2134         case BoolTest::gt:
  2156             // still be outside of loop range.
  2159             // still be outside of loop range.
  2157             conditional_rc = !loop->dominates_backedge(iff) || RangeLimitCheck;
  2160             conditional_rc = !loop->dominates_backedge(iff) || RangeLimitCheck;
  2158           }
  2161           }
  2159           break;
  2162           break;
  2160         default:
  2163         default:
  2161 #ifndef PRODUCT
  2164           if (PrintOpto) {
  2162           if( PrintOpto )
       
  2163             tty->print_cr("missed RCE opportunity");
  2165             tty->print_cr("missed RCE opportunity");
  2164 #endif
  2166           }
  2165           continue;             // Unhandled case
  2167           continue;             // Unhandled case
  2166         }
  2168         }
  2167       }
  2169       }
  2168 
  2170 
  2169       // Kill the eliminated test
  2171       // Kill the eliminated test
  2503     if (PartialPeelLoop && phase->partial_peel(this, old_new)) {
  2505     if (PartialPeelLoop && phase->partial_peel(this, old_new)) {
  2504       // Partial peel succeeded so terminate this round of loop opts
  2506       // Partial peel succeeded so terminate this round of loop opts
  2505       return false;
  2507       return false;
  2506     }
  2508     }
  2507     if (should_peel) {            // Should we peel?
  2509     if (should_peel) {            // Should we peel?
  2508 #ifndef PRODUCT
  2510       if (PrintOpto) { tty->print_cr("should_peel"); }
  2509       if (PrintOpto) tty->print_cr("should_peel");
       
  2510 #endif
       
  2511       phase->do_peeling(this,old_new);
  2511       phase->do_peeling(this,old_new);
  2512     } else if (should_unswitch) {
  2512     } else if (should_unswitch) {
  2513       phase->do_unswitching(this, old_new);
  2513       phase->do_unswitching(this, old_new);
  2514     }
  2514     }
  2515     return true;
  2515     return true;