This patch relaxes restrictions on types of latch condition and range check.
In current implementation, they should match. This patch allows to handle
wide range checks against narrow condition. The motivating example is the
following:
int N = ... for (long i = 0; (int) i < N; i++) { if (i >= length) deopt; }
I can't convince myself this is correct when the IV would overflow. Can you explain why we don't need some form of overflow check here? Note that in LoopPredication in isSafeToTruncate, we *do* have an overflow check.