RFR: 8298935: fix cyclic dependency bug in create_pack logic in SuperWord::find_adjacent_refs [v9]

Emanuel Peter epeter at openjdk.org
Tue Mar 7 09:52:30 UTC 2023


On Tue, 7 Mar 2023 06:33:47 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> I now removed all such negative IR rules.
>
> 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`.

I could remove the exhaustive loop over all `MaxVectorSize` values, and instead run only a few per `AVX / SSE` setting. That may make it a bit more efficient, and easier to test everything at once on one machine.

I can also make one file `x86` specific (require `x86/x64`) and the other file allows all other platforms (but only contains the `asimd` IR rules). I would probably have different scenarios for that second file, since ARM chips have various `MaxVectorSize`, depending on hardware.

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

PR: https://git.openjdk.org/jdk/pull/12350


More information about the hotspot-compiler-dev mailing list