src/hotspot/share/opto/loopTransform.cpp
changeset 51078 fc6cfe40e32a
parent 51017 dd7ce84016a5
child 52608 61241fc2217a
equal deleted inserted replaced
51077:9baa91bc7567 51078:fc6cfe40e32a
   766   }
   766   }
   767 
   767 
   768   Node *init_n = cl->init_trip();
   768   Node *init_n = cl->init_trip();
   769   Node *limit_n = cl->limit();
   769   Node *limit_n = cl->limit();
   770   int stride_con = cl->stride_con();
   770   int stride_con = cl->stride_con();
       
   771   if (limit_n == NULL) return false; // We will dereference it below.
       
   772 
   771   // Non-constant bounds.
   773   // Non-constant bounds.
   772   // Protect against over-unrolling when init or/and limit are not constant
   774   // Protect against over-unrolling when init or/and limit are not constant
   773   // (so that trip_count's init value is maxint) but iv range is known.
   775   // (so that trip_count's init value is maxint) but iv range is known.
   774   if (init_n   == NULL || !init_n->is_Con()  ||
   776   if (init_n == NULL || !init_n->is_Con() || !limit_n->is_Con()) {
   775       limit_n  == NULL || !limit_n->is_Con()) {
       
   776     Node* phi = cl->phi();
   777     Node* phi = cl->phi();
   777     if (phi != NULL) {
   778     if (phi != NULL) {
   778       assert(phi->is_Phi() && phi->in(0) == _head, "Counted loop should have iv phi.");
   779       assert(phi->is_Phi() && phi->in(0) == _head, "Counted loop should have iv phi.");
   779       const TypeInt* iv_type = phase->_igvn.type(phi)->is_int();
   780       const TypeInt* iv_type = phase->_igvn.type(phi)->is_int();
   780       int next_stride = stride_con * 2; // stride after this unroll
   781       int next_stride = stride_con * 2; // stride after this unroll