RFR: 8342692: C2: long counted loop/long range checks: don't create loop-nest for short running loops [v32]

Roland Westrelin roland at openjdk.org
Tue May 27 15:18:02 UTC 2025


On Tue, 27 May 2025 07:22:17 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Hmm, or does the `int` `bt` come from `StressLongCountedLoop`, which complicates things here?
>
> Could `iters_limit` be constant?

> Are only long-loops allowed, or can there be int loops here too? You talk about long range checks, which makes me believe this is about long loops. But then below you check for the `bt` of the head, so could that be int?

No. There are 2 cases:

1- a long counted loop that may or may not have long range checks
2- an int counted loop that has long range checks

With 2-, the counted loop is turned into a 2 loops nest. That's required to transform the long range checks into int range checks so they can be optimized by range check elimination. This is not new in this change.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21630#discussion_r2109479394


More information about the hotspot-compiler-dev mailing list