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

Emanuel Peter epeter at openjdk.org
Mon May 26 19:00:07 UTC 2025


On Mon, 26 May 2025 18:50:14 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/c2_globals.hpp line 860:
> 
>> 858:   develop(bool, StressShortRunningLongLoop, false,                          \
>> 859:           "Speculate all long counted loops are short running when bounds " \
>> 860:           "are unknown even if profile data doesn't say so.")               \
> 
> Why only when bounds are unknown?

I would like to see at least a hello-world test where you use this flag, to make sure it does not completely rot ;)

> src/hotspot/share/opto/castnode.cpp line 327:
> 
>> 325: }
>> 326: 
>> 327: bool CastLLNode::inner_loop_backedge(Node* proj) {
> 
> Suggestion:
> 
> bool CastLLNode::is_inner_loop_backedge(Node* proj) {
> 
> Optional. It would help me know that it is just a check. Otherwise, I wonder if we might "make" the inner loop backedge.

Also: the only use is with input from `ProjNode* proj_out_or_null`, so why not require `ProjNode*` as input here?

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

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


More information about the hotspot-compiler-dev mailing list