RFR: 8353290: C2: Refactor PhaseIdealLoop::is_counted_loop() [v29]

Christian Hagedorn chagedorn at openjdk.org
Thu Jan 22 08:05:07 UTC 2026


On Wed, 14 Jan 2026 16:38:25 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 incrementally with one additional commit since the last revision:
> 
>   fix safepoint detection

With your latest safepoint fix, the closed test is no longer failing! So, that seems to have fixed the issue. I'm currently running the DIFF patch with your fix on top up to tier7. Looking good so far. I'm also running some testing again for this patch only up to tier7. Will report back once it's complete (probably takes a while).

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

PR Comment: https://git.openjdk.org/jdk/pull/24458#issuecomment-3783056595


More information about the hotspot-compiler-dev mailing list