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

Emanuel Peter epeter at openjdk.org
Fri Oct 24 15:04:20 UTC 2025


On Wed, 15 Oct 2025 08:46:36 GMT, Qizheng Xing <qxing at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/loopopts/TestRedundantSafepointElimination.java line 66:
>> 
>>> (failed to retrieve contents of file, check the PR for context)
>> So these do not end up being CountedLoop?
>
> The first one (`loopConst`) is a counted loop. The second one (`loopVar`) is not, because it calls `empty` (not inlined) which may modify `loopCount`.
> 
> Both the two loops should have no safepoints, since the `empty` call always polls the safepoint.

@MaxXSoft Can you please add some code comments in the test? Just if the rule ever fails, it would be nice to know why the rule was added ;)

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

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


More information about the hotspot-compiler-dev mailing list