RFR: 8299671: speed up compiler/intrinsics/string/TestStringLatin1IndexOfChar.java
Vladimir Kozlov
kvn at openjdk.org
Thu Jan 5 18:10:53 UTC 2023
On Thu, 5 Jan 2023 13:40:10 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> This test took very long, it was the slowest compiler test.
> In total it took almost 3 minutes on my laptop. Now it is down to half a minute. The run statements also are about 10x faster now.
>
> We could parallelize the run statements, but given that it is already fairly small the benefit is not so big, and it would imply overheads of parallelization, like loading libraries multiple times.
>
> Goal of this test: trigger `indexOfChar` intrinsic inside the test functions. To trigger this reliably without too many repetitions of the test functions, we had set the flags `-XX:Tier4InvocationThreshold=200 -XX:CompileThreshold=100`. But this also triggers lots of other compilations, and makes everything slow.
>
> I removed those flags, and used the white-box API to trigger compilation of the test functions. With sufficient warm-up, the paths to the intrinsic is hot, and we get intrinsification of `indexOfChar`.
test/hotspot/jtreg/compiler/intrinsics/string/TestStringLatin1IndexOfChar.java line 44:
> 42: * -Xbatch -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_indexOfL_char compiler.intrinsics.string.TestStringLatin1IndexOfChar
> 43: * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
> 44: * -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:UseSSE=0 compiler.intrinsics.string.TestStringLatin1IndexOfChar
I think `-XX:UseSSE=0` was typo in original changes. It should be `-XX:UseAVX=0` because we don't support anything less than SSE2 with 64-bit VM.
`StrIndexOf` is only supported when `UseSSE42Intrinsics == true` for both 32- and 64-bit VMs. See `x86_*.ad` files.
-------------
PR: https://git.openjdk.org/jdk/pull/11862
More information about the hotspot-compiler-dev
mailing list