src/share/vm/opto/loopTransform.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
7054211 Cdiff src/share/vm/opto/loopTransform.cpp
src/share/vm/opto/loopTransform.cpp
Print this page
*** 707,720 ****
--- 707,723 ----
stride_con < 0 && ((limit_type->_lo - stride_con) <= limit_type->_lo))
return false; // overflow
// Adjust body_size to determine if we unroll or not
uint body_size = _body.size();
+ // Key test to unroll loop in CRC32 java code
+ int xors_in_loop = 0;
// Also count ModL, DivL and MulL which expand mightly
for (uint k = 0; k < _body.size(); k++) {
Node* n = _body.at(k);
switch (n->Opcode()) {
+ case Op_XorI: xors_in_loop++; break; // CRC32 java code
case Op_ModL: body_size += 30; break;
case Op_DivL: body_size += 30; break;
case Op_MulL: body_size += 10; break;
case Op_StrComp:
case Op_StrEquals:
*** 727,736 ****
--- 730,740 ----
} // switch
}
// Check for being too big
if (body_size > (uint)LoopUnrollLimit) {
+ if (xors_in_loop >= 4 && body_size < (uint)LoopUnrollLimit*4) return true;
// Normal case: loop too big
return false;
}
// Unroll once! (Each trip will soon do double iterations)
src/share/vm/opto/loopTransform.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File