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

Emanuel Peter epeter at openjdk.org
Mon May 19 09:11:03 UTC 2025


On Mon, 19 May 2025 08:14:48 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Roland Westrelin has updated the pull request incrementally with 11 additional commits since the last revision:
>> 
>>  - Update src/hotspot/share/opto/loopnode.cpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - Update src/hotspot/share/opto/graphKit.cpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - Update src/hotspot/share/opto/castnode.cpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - Update src/hotspot/share/opto/loopnode.hpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - Update src/hotspot/share/opto/loopnode.hpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - Update src/hotspot/share/opto/loopnode.cpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - Update src/hotspot/share/opto/loopnode.cpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - Update src/hotspot/share/opto/loopnode.cpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - Update src/hotspot/share/opto/loopnode.cpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - Update src/hotspot/share/opto/loopnode.cpp
>>    
>>    Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>>  - ... and 1 more: https://git.openjdk.org/jdk/compare/b0129598...2164c15f
>
> 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`.

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

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


More information about the hotspot-compiler-dev mailing list