RFR: 8342692: C2: long counted loop/long range checks: don't create loop-nest for short running loops [v22]
Roland Westrelin
roland at openjdk.org
Wed May 21 07:45:58 UTC 2025
On Mon, 19 May 2025 09:08:41 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/opto/c2_globals.hpp line 839:
>>
>>> 837: product(bool, ShortRunningLongLoop, true, DIAGNOSTIC, \
>>> 838: "long counted loop/long range checks: don't create loop nest if " \
>>> 839: "loop runs for small enough number of iterations.") \
>>
>> It sounds like we are doing this:
>> Disable an exception, which disables an optimization.
>>
>> This double negation can be a little confusing / ambiguous.
>>
>> I wonder if we should instead have a limit here, which we can move to 0, or higher.
>> That would allow us to benchmark with different levels more easily too.
>
> It could be named `ShortRunningLongLoopIterationLimit`.
See https://github.com/openjdk/jdk/pull/21630#issuecomment-2896932626
I don't think this makes sense. As long as we can avoid the loop nest, that should beneficial. There's no benefit to the loop nest but it can be required for correctness. So I don't expect we want to tune anything.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21630#discussion_r2099594700
More information about the hotspot-compiler-dev
mailing list