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

Qizheng Xing qxing at openjdk.org
Thu Apr 10 02:25:28 UTC 2025


On Wed, 2 Apr 2025 07:19:21 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> 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.

@eme64 I try to run `jdk_foreign` tests with commit 45b7c748737f38c33c4666d17101b051b2fbe2ae on x86-64, and the following `make` command always results in a safepoint timeout in `TestStringEncodingJumbo.java`:


make test CONF=release TEST="jtreg:test/jdk:jdk_foreign" JTREG="JAVA_OPTIONS=-XX:+UnlockDiagnosticVMOptions -XX:+SafepointTimeout -XX:+AbortVMOnSafepointTimeout -XX:SafepointTimeoutDelay=500"


> And what about late inlining? Does that not happen after loop opts? Maybe we insert new SafePoints when inlining, I simply don't know enough about that.

It seems that late inlining after loop opts only performs strength reduction, i.e. converts those dynamic calls to direct calls, and does not incrementally inline callers into callees. Note that `inlining_incrementally` should always be false when calling `process_late_inline_calls_no_inline`, so no inlining is allowed:

https://github.com/openjdk/jdk/blob/45b7c748737f38c33c4666d17101b051b2fbe2ae/src/hotspot/share/opto/compile.cpp#L2215-L2220

> 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?

I'll do that later, thanks for your suggestions!

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

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


More information about the hotspot-compiler-dev mailing list