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

Emanuel Peter epeter at openjdk.org
Wed Apr 2 07:25:25 UTC 2025


On Wed, 26 Mar 2025 08:59:07 GMT, Qizheng Xing <qxing at openjdk.org> wrote:

>> Qizheng Xing has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Merge branch 'master' into enhance-loop-safepoint-elim
>>  - Add IR test and microbench.
>>  - Make `PhaseIdealLoop` eliminate more redundant safepoints in loops.
>
> The second question:
> 
>> If we now removed safepoints in places where we would actually have needed them: how would we find out? I suppose we would get longer time to safepoint - higher latency in some cases. How would we catch this with our tests?
> 
> I tried running tier1 tests with `JAVA_OPTIONS=-XX:+UnlockDiagnosticVMOptions -XX:+SafepointTimeout -XX:+AbortVMOnSafepointTimeout -XX:SafepointTimeoutDelay=1000`, and there were no failures.
> 
> Running with `-XX:SafepointTimeoutDelay=500` caused 1 random JDK test case to fail. But then I tried to build a JDK without this patch, and it still had the random failure with this option.

@MaxXSoft 

> Running with -XX:SafepointTimeoutDelay=500 caused 1 random JDK test case to fail. But then I tried to build a JDK without this patch, and it still had the random failure with this option.

Wow, that sounds like we do not safepoint for half a second in that case. That could be a bug. Could you please tell me what test it is, and how you ran it? We may want to file a bug and investigate it.

@MaxXSoft Would you mind improving the documentation comments, so that they are easier to understand? Maybe you can even add more comments around your code change, to "prove" why it is ok to do what we would do with your change?

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

PR Comment: https://git.openjdk.org/jdk/pull/23057#issuecomment-2771559333
PR Comment: https://git.openjdk.org/jdk/pull/23057#issuecomment-2771565388


More information about the hotspot-compiler-dev mailing list