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

Roland Westrelin roland at openjdk.org
Fri May 9 12:12:59 UTC 2025


On Thu, 8 May 2025 10:36:33 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 43 commits:
>> 
>>  - review
>>  - Merge branch 'master' into JDK-8342692
>>  - merge fix
>>  - Merge branch 'master' into JDK-8342692
>>  - merge fix
>>  - Merge branch 'master' into JDK-8342692
>>  - merge
>>  - Merge branch 'master' into JDK-8342692
>>  - Merge branch 'master' into JDK-8342692
>>  - whitespace
>>  - ... and 33 more: https://git.openjdk.org/jdk/compare/4458719a...ed774a56
>
> src/hotspot/share/runtime/deoptimization.hpp line 122:
> 
>> 120:     Reason_short_running_long_loop,    // profile reports loop runs for small number of iterations
>> 121: #if INCLUDE_JVMCI
>> 122:     Reason_aliasing = Reason_short_running_long_loop, // optimistic assumption about aliasing failed
> 
> Why is that required?

Otherwise, this assert:


assert((1 << _reason_bits) >= Reason_LIMIT, "enough bits");


fails. Rather than tweak the allocation of bits to `_action_bits`, `_reason_bits`, `_debug_id_bits`, to extend `_reason_bits`, I thought it was simpler to have c2 and graal share the encoding of a reason given graal doesn't use the new `Reason_short_running_long_loop` and c2 doesn't use the jvmci specific `Reason_aliasing`.

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

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


More information about the hotspot-compiler-dev mailing list