609 overflow = false; |
609 overflow = false; |
610 Node* max_idx_expr = NULL; |
610 Node* max_idx_expr = NULL; |
611 const TypeInt* idx_type = TypeInt::INT; |
611 const TypeInt* idx_type = TypeInt::INT; |
612 if ((stride > 0) == (scale > 0) == upper) { |
612 if ((stride > 0) == (scale > 0) == upper) { |
613 if (TraceLoopPredicate) { |
613 if (TraceLoopPredicate) { |
614 predString->print(limit->is_Con() ? "(%d " : "(limit ", con_limit); |
614 if (limit->is_Con()) { |
|
615 predString->print("(%d ", con_limit); |
|
616 } else { |
|
617 predString->print("(limit "); |
|
618 } |
615 predString->print("- %d) ", stride); |
619 predString->print("- %d) ", stride); |
616 } |
620 } |
617 // Check if (limit - stride) may overflow |
621 // Check if (limit - stride) may overflow |
618 const TypeInt* limit_type = _igvn.type(limit)->isa_int(); |
622 const TypeInt* limit_type = _igvn.type(limit)->isa_int(); |
619 jint limit_lo = limit_type->_lo; |
623 jint limit_lo = limit_type->_lo; |
637 max_idx_expr = new (C) SubLNode(limit, con_stride); |
641 max_idx_expr = new (C) SubLNode(limit, con_stride); |
638 } |
642 } |
639 register_new_node(max_idx_expr, ctrl); |
643 register_new_node(max_idx_expr, ctrl); |
640 } else { |
644 } else { |
641 if (TraceLoopPredicate) { |
645 if (TraceLoopPredicate) { |
642 predString->print(init->is_Con() ? "%d " : "init ", con_init); |
646 if (init->is_Con()) { |
|
647 predString->print("%d ", con_init); |
|
648 } else { |
|
649 predString->print("init "); |
|
650 } |
643 } |
651 } |
644 idx_type = _igvn.type(init)->isa_int(); |
652 idx_type = _igvn.type(init)->isa_int(); |
645 max_idx_expr = init; |
653 max_idx_expr = init; |
646 } |
654 } |
647 |
655 |
673 register_new_node(max_idx_expr, ctrl); |
681 register_new_node(max_idx_expr, ctrl); |
674 } |
682 } |
675 |
683 |
676 if (offset && (!offset->is_Con() || con_offset != 0)){ |
684 if (offset && (!offset->is_Con() || con_offset != 0)){ |
677 if (TraceLoopPredicate) { |
685 if (TraceLoopPredicate) { |
678 predString->print(offset->is_Con() ? "+ %d " : "+ offset", con_offset); |
686 if (offset->is_Con()) { |
|
687 predString->print("+ %d ", con_offset); |
|
688 } else { |
|
689 predString->print("+ offset"); |
|
690 } |
679 } |
691 } |
680 // Check if (max_idx_expr + offset) may overflow |
692 // Check if (max_idx_expr + offset) may overflow |
681 const TypeInt* offset_type = _igvn.type(offset)->isa_int(); |
693 const TypeInt* offset_type = _igvn.type(offset)->isa_int(); |
682 jint lo = idx_type->_lo + offset_type->_lo; |
694 jint lo = idx_type->_lo + offset_type->_lo; |
683 jint hi = idx_type->_hi + offset_type->_hi; |
695 jint hi = idx_type->_hi + offset_type->_hi; |