1.1 --- a/src/share/vm/opto/loopTransform.cpp Sun Jan 31 10:07:50 2016 -0800 1.2 +++ b/src/share/vm/opto/loopTransform.cpp Wed Jan 27 09:02:51 2016 +0100 1.3 @@ -2432,7 +2432,7 @@ 1.4 1.5 //============================================================================= 1.6 // Process all the loops in the loop tree and replace any fill 1.7 -// patterns with an intrisc version. 1.8 +// patterns with an intrinsic version. 1.9 bool PhaseIdealLoop::do_intrinsify_fill() { 1.10 bool changed = false; 1.11 for (LoopTreeIterator iter(_ltree_root); !iter.done(); iter.next()) { 1.12 @@ -2530,8 +2530,9 @@ 1.13 } 1.14 1.15 // Make sure the address expression can be handled. It should be 1.16 - // head->phi * elsize + con. head->phi might have a ConvI2L. 1.17 + // head->phi * elsize + con. head->phi might have a ConvI2L(CastII()). 1.18 Node* elements[4]; 1.19 + Node* cast = NULL; 1.20 Node* conv = NULL; 1.21 bool found_index = false; 1.22 int count = store->in(MemNode::Address)->as_AddP()->unpack_offsets(elements, ARRAY_SIZE(elements)); 1.23 @@ -2546,6 +2547,12 @@ 1.24 conv = value; 1.25 value = value->in(1); 1.26 } 1.27 + if (value->Opcode() == Op_CastII && 1.28 + value->as_CastII()->has_range_check()) { 1.29 + // Skip range check dependent CastII nodes 1.30 + cast = value; 1.31 + value = value->in(1); 1.32 + } 1.33 #endif 1.34 if (value != head->phi()) { 1.35 msg = "unhandled shift in address"; 1.36 @@ -2558,9 +2565,16 @@ 1.37 } 1.38 } 1.39 } else if (n->Opcode() == Op_ConvI2L && conv == NULL) { 1.40 - if (n->in(1) == head->phi()) { 1.41 + conv = n; 1.42 + n = n->in(1); 1.43 + if (n->Opcode() == Op_CastII && 1.44 + n->as_CastII()->has_range_check()) { 1.45 + // Skip range check dependent CastII nodes 1.46 + cast = n; 1.47 + n = n->in(1); 1.48 + } 1.49 + if (n == head->phi()) { 1.50 found_index = true; 1.51 - conv = n; 1.52 } else { 1.53 msg = "unhandled input to ConvI2L"; 1.54 } 1.55 @@ -2619,6 +2633,7 @@ 1.56 // Address elements are ok 1.57 if (con) ok.set(con->_idx); 1.58 if (shift) ok.set(shift->_idx); 1.59 + if (cast) ok.set(cast->_idx); 1.60 if (conv) ok.set(conv->_idx); 1.61 1.62 for (uint i = 0; msg == NULL && i < lpt->_body.size(); i++) {