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:01:30 UTC 2025


On Tue, 27 May 2025 06:54:29 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   review
>
> src/hotspot/share/opto/loopnode.cpp line 1096:
> 
>> 1094:     if (ShortRunningLongLoop) {
>> 1095:       add_parse_predicate(Deoptimization::Reason_short_running_long_loop, inner_head, outer_ilt, cloned_sfpt);
>> 1096:     }
> 
> What happens if there are multiple loops in a method, and one traps because it is longer than expected? Do we then also re-compile the other loop without the new predicate?

FTR, there's a bug here: https://bugs.openjdk.org/browse/JDK-8350330
The count of traps of this type for this method needs to exceed `PerMethodTrapLimit` for the speculation to be disabled.

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

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


More information about the hotspot-compiler-dev mailing list