RFR: 8347499: C2: Make `PhaseIdealLoop` eliminate more redundant safepoints in loops [v3]

Qizheng Xing qxing at openjdk.org
Wed Oct 29 09:02:16 UTC 2025


On Mon, 27 Oct 2025 14:40:05 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/loopnode.cpp line 3840:
>> 
>>> 3838: //     inside any nested loop, then that loop is okay
>>> 3839: //  E) Otherwise, if an outer loop's ncsfpt on the idom-path is nested in
>>> 3840: //     an inner loop, we need to prevent the inner loop from deleting it
>> 
>> Nice, that's indeed an improvement :)
>
> It would be nice to make sure all cases here have an IR test which is not the case AFAICT. Can you open a JBS issue for that?

@rwestrel @eme64 Do IR tests in `TestRedundantSafepointElimination.java` in this patch cover all these cases? Specifically:

* Case A: `testTopLevelCountedLoop`, `testTopLevelCountedLoopWithDomCall`
* Case B: tests containing nested loops
* Case C: `testOuterLoopWithDomCall`
* Case D: `testOuterLoopWithLocalNonCallSafepoint`
* Case E: `testLoopNeedsToPreserveSafepoint`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23057#discussion_r2472199900


More information about the hotspot-compiler-dev mailing list