RFR(S): 8244086: Following 8241492, strip mined loop may run extra iterations

Roland Westrelin rwestrel at redhat.com
Thu Apr 30 08:13:07 UTC 2020


Hi Pengfei,

Thanks for looking at this.

> Just one question: If the case that "limit < init" is quite rare
> (perhaps occurs only with some "synchronized (new Object()) {}" hack),
> is it better to add a "limit >= init" prediction and put it before the
> outer loop? I see the limit check for counted loops does in this way
> to avoid the overflow beyond max_jint.

That seems possible but given the new code is out of the inner loop and
so likely not performance sensitive, the extra complexity doesn't feel
right.

If the concern is performance, the new checks are in fact not needed if
the loop was split into a pre/main/post loops. Emitting the extra checks
only for "normal" loops would make them a lot less common.

Roland.



More information about the hotspot-compiler-dev mailing list