RFR: 8298935: fix cyclic dependency bug in create_pack logic in SuperWord::find_adjacent_refs [v9]
Jatin Bhateja
jbhateja at openjdk.org
Tue Mar 7 11:06:25 UTC 2023
On Tue, 7 Mar 2023 09:48:46 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Hi @eme64 ,
>> Few more suggestions, my original request was to write few hand crafted tests with combinations of AlignVector, Vectorize and MaxVectorSize options. All the test points in TestDependencyOffsets.java are mainly around two kernels, forward writes (RAW/true dependency) and forward reads (WAR/anti-dependence) but exhaustively generates multiple IR rules.
>> applyIfCPUFeature uses VM identified CPU feature checks which are constrained by UseSSE and UseAVX options. You may extend your script to generate curated scenarios like following to trigger more rules.
>>
>>
>> // CPU: sse4.1 to avx -> vector_width: 16 -> elements in vector: 4
>> scenarios[0] = new Scenario(0, "-XX:-/+AlignVector", "-XX:MaxVectorSize=XXX", "-XX:UseAVX=0");
>> // CPU: avx2 -> vector_width: 32 -> elements in vector: 8
>> scenarios[1] = new Scenario(1, "-XX:-/+AlignVector", "-XX:MaxVectorSize=XXX", "-XX:UseAVX=2");
>> // CPU: avx512 -> vector_width: 64 -> elements in vector: 16
>> scenarios[2] = new Scenario(2, "-XX:-/+AlignVector", "-XX:MaxVectorSize=XXX", "-XX:UseAVX=3");
>>
>>
>> Since there are mainly 4 categories of features.
>>
>>
>> CPROMPT>grep "applyIfCPUFeatureAnd" TestDependencyOffsets.java | sort -u | uniq
>> applyIfCPUFeatureAnd = {"avx2", "true", "avx512bw", "false"})
>> applyIfCPUFeatureAnd = {"avx2", "true", "avx512", "false"})
>> applyIfCPUFeatureAnd = {"avx", "true", "avx512", "false"})
>> applyIfCPUFeatureAnd = {"sse4.1", "true", "avx2", "false"})
>> applyIfCPUFeatureAnd = {"sse4.1", "true", "avx", "false"})
>>
>>
>> Also, this test file is script generated hence we may generate separate test files for AARCH64 and X86 to make the tests more maintainable.
>
> Hi @jatin-bhateja .
> At Oracle we run the `compiler/loopopts/superword` and `compiler/vectorization` tests with various `AVX` and `SSE` settings, including the `UseKNLSetting`.
>
> Actually, I'm against splitting the test for different platforms. Because we have a few tests that now only get executed on one platform, and the features might be rotting on other platforms without us noticing it. Also: I don't like code duplication. If someone wants to add a test, then it has to be added in multiple files. Not great.
>
> My suggestion: Instead of the Scenarios, I can create multiple jtreg-test statements. Advantages:
>
> 1. The can run in parallel.
> 2. I can require platform features.
> 3. I can have different jvm-flags for different runs.
>
> That way I can make some jtreg-test statements for the `AVX / SSE` platforms (and have different `UseAVX` settings). And other jtreg-test statements for other platforms (eg. aarch64 `asimd == Neon`). But I will keep the IR rules for all platforms at the specific `@Test`.
Agree, it will be better if we can run multiple IR rules on one target using UseSSE/UseAVX flags rather than having tight target dependencies.
-------------
PR: https://git.openjdk.org/jdk/pull/12350
More information about the hotspot-compiler-dev
mailing list