diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp index 90b353b522e..eef7c798108 100644 --- a/src/hotspot/share/opto/loopnode.cpp +++ b/src/hotspot/share/opto/loopnode.cpp @@ -2361,7 +2361,7 @@ bool CountedLoopConverter::is_counted_loop() { // there is no overflow of the iv phi after the first iteration. In this case, we don't need to check (ii) // again and can skip the predicate. - const TypeInteger* limit_t = _structure.exit_test().limit_t(*igvn); + const TypeInteger* limit_t = _structure.exit_test().limit_t(*igvn, _iv_bt); Node* raw_limit = _structure.exit_test().raw_limit(); StrideOverflowState stride_overflow_state = check_stride_overflow(_structure.final_limit_correction(), limit_t, _iv_bt); @@ -2496,7 +2496,7 @@ bool CountedLoopConverter::LoopStructure::is_infinite_loop() const { PhaseIterGVN& igvn = _phase->igvn(); const TypeInteger* incr_t = igvn.type(_iv_incr.incr())->is_integer(_iv_bt); - const TypeInteger* limit_t = _exit_test.limit_t(igvn); + const TypeInteger* limit_t = _exit_test.limit_t(igvn, _iv_bt); if (limit_t->hi_as_long() > incr_t->hi_as_long()) { // if the limit can have a higher value than the increment (before the phi) return true; diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 8139ea91972..001f18cce0a 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -1409,11 +1409,11 @@ public: } return _limit; } - const TypeInteger* limit_t(PhaseIterGVN& igvn) const { + const TypeInteger* limit_t(PhaseIterGVN& igvn, BasicType bt) const { if (_should_speculatively_narrow_limit) { return TypeLong::INT->filter(igvn.type(_limit)->is_long())->is_long(); } - return igvn.type(_limit)->is_int(); + return igvn.type(_limit)->is_integer(bt); } bool can_speculatively_narrow_limit() {