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 06:37:24 UTC 2023
The message from this sender included one or more files
which could not be scanned for virus detection; do not
open these files unless you are certain of the sender's intent.
----------------------------------------------------------------------
On Thu, 2 Mar 2023 15:56:23 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> I realized I have lots of negative IR rules that check that we do NOT vectorize if I expect cyclic dependency. But these negative rules are difficult, there may always be some other factor that leads to shorter vector sizes than what I expect. And then it vectorizes, and does not encounter a cyclic dependency. So I will have to remove all these negative IR rules.
>>
>> @jatin-bhateja was there any positive IR rule that failed? One that did expect vectorization, but it did not in fact vectorize?
>
> 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.
-------------
PR: https://git.openjdk.org/jdk/pull/12350
More information about the hotspot-compiler-dev
mailing list