< prev index next >

src/hotspot/share/opto/loopTransform.cpp

Print this page

 957     return false;  // overflow
 958 
 959   // Rudimentary cost model to estimate loop unrolling
 960   // factor.
 961   // Adjust body_size to determine if we unroll or not
 962   uint body_size = _body.size();
 963   // Key test to unroll loop in CRC32 java code
 964   int xors_in_loop = 0;
 965   // Also count ModL, DivL and MulL which expand mightly
 966   for (uint k = 0; k < _body.size(); k++) {
 967     Node* n = _body.at(k);
 968     switch (n->Opcode()) {
 969       case Op_XorI: xors_in_loop++; break; // CRC32 java code
 970       case Op_ModL: body_size += 30; break;
 971       case Op_DivL: body_size += 30; break;
 972       case Op_MulL: body_size += 10; break;
 973       case Op_RoundF:
 974       case Op_RoundD: {
 975           body_size += Matcher::scalar_op_pre_select_sz_estimate(n->Opcode(), n->bottom_type()->basic_type());
 976       } break;



 977       case Op_RoundVF:
 978       case Op_RoundVD:
 979       case Op_PopCountVI:
 980       case Op_PopCountVL: {
 981         const TypeVect* vt = n->bottom_type()->is_vect();
 982         body_size += Matcher::vector_op_pre_select_sz_estimate(n->Opcode(), vt->element_basic_type(), vt->length());
 983       } break;
 984       case Op_StrComp:
 985       case Op_StrEquals:
 986       case Op_StrIndexOf:
 987       case Op_StrIndexOfChar:
 988       case Op_EncodeISOArray:
 989       case Op_AryEq:
 990       case Op_CountPositives: {
 991         // Do not unroll a loop with String intrinsics code.
 992         // String intrinsics are large and have loops.
 993         return false;
 994       }
 995 #if INCLUDE_RTM_OPT
 996       case Op_FastLock:

 957     return false;  // overflow
 958 
 959   // Rudimentary cost model to estimate loop unrolling
 960   // factor.
 961   // Adjust body_size to determine if we unroll or not
 962   uint body_size = _body.size();
 963   // Key test to unroll loop in CRC32 java code
 964   int xors_in_loop = 0;
 965   // Also count ModL, DivL and MulL which expand mightly
 966   for (uint k = 0; k < _body.size(); k++) {
 967     Node* n = _body.at(k);
 968     switch (n->Opcode()) {
 969       case Op_XorI: xors_in_loop++; break; // CRC32 java code
 970       case Op_ModL: body_size += 30; break;
 971       case Op_DivL: body_size += 30; break;
 972       case Op_MulL: body_size += 10; break;
 973       case Op_RoundF:
 974       case Op_RoundD: {
 975           body_size += Matcher::scalar_op_pre_select_sz_estimate(n->Opcode(), n->bottom_type()->basic_type());
 976       } break;
 977       case Op_CountTrailingZerosV:
 978       case Op_CountLeadingZerosV:
 979       case Op_ReverseV:
 980       case Op_RoundVF:
 981       case Op_RoundVD:
 982       case Op_PopCountVI:
 983       case Op_PopCountVL: {
 984         const TypeVect* vt = n->bottom_type()->is_vect();
 985         body_size += Matcher::vector_op_pre_select_sz_estimate(n->Opcode(), vt->element_basic_type(), vt->length());
 986       } break;
 987       case Op_StrComp:
 988       case Op_StrEquals:
 989       case Op_StrIndexOf:
 990       case Op_StrIndexOfChar:
 991       case Op_EncodeISOArray:
 992       case Op_AryEq:
 993       case Op_CountPositives: {
 994         // Do not unroll a loop with String intrinsics code.
 995         // String intrinsics are large and have loops.
 996         return false;
 997       }
 998 #if INCLUDE_RTM_OPT
 999       case Op_FastLock:
< prev index next >