RFR: 8353290: C2: Refactor PhaseIdealLoop::is_counted_loop() [v12]
    Roland Westrelin 
    roland at openjdk.org
       
    Wed Oct  1 07:47:56 UTC 2025
    
    
  
On Wed, 1 Oct 2025 01:23:30 GMT, Kangcheng Xu <kxu at openjdk.org> wrote:
>> This PR refactors `PhaseIdealLoop::is_counted_loop()` into (mostly) `CountedLoopConverter::is_counted_loop()` and `CountedLoopConverter::convert()` to decouple the detection and conversion code. This enables us to try different loop configurations easily and finally convert once a counted loop is found. 
>> 
>> A nested `PhaseIdealLoop::CountedLoopConverter` class is created to handle the context, but I'm not if this is the best name or place for it. Please let me know what you think.
>> 
>> Blocks [JDK-8336759](https://bugs.openjdk.org/browse/JDK-8336759).
>
> Kangcheng Xu has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 29 commits:
> 
>  - Merge remote-tracking branch 'origin/master' into counted-loop-refactor
>    
>    # Conflicts:
>    #	src/hotspot/share/opto/loopnode.cpp
>  - futher refactor counted loop conversion
>  - WIP: remove unused #include
>  - WIP: refactor structs to classes
>  - WIP: removed dead code, renamed fields and signatures
>  - Merge branch 'openjdk:master' into counted-loop-refactor
>  - Merge remote-tracking branch 'origin/master' into counted-loop-refactor
>    
>    # Conflicts:
>    #	src/hotspot/share/opto/loopnode.cpp
>    #	src/hotspot/share/opto/loopnode.hpp
>  - Merge branch 'master' into counted-loop-refactor
>    
>    # Conflicts:
>    #	src/hotspot/share/opto/loopnode.cpp
>    #	src/hotspot/share/opto/loopnode.hpp
>    #	src/hotspot/share/opto/loopopts.cpp
>  - Merge remote-tracking branch 'origin/master' into counted-loop-refactor
>  - further refactor is_counted_loop() by extracting functions
>  - ... and 19 more: https://git.openjdk.org/jdk/compare/0366d882...b1d27675
src/hotspot/share/opto/loopopts.cpp line 1695:
> 1693:       !n->is_OpaqueInitializedAssertionPredicate() &&
> 1694:       !n->is_OpaqueTemplateAssertionPredicate() &&
> 1695:       !n->is_Type()) {
This change seems unrelated. Bad merge?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24458#discussion_r2393732195
    
    
More information about the hotspot-compiler-dev
mailing list