RFR: 8287794: Reverse*VNode::Identity problem [v3]

Xiaohong Gong xgong at openjdk.org
Thu Jul 28 03:12:39 UTC 2022


On Wed, 27 Jul 2022 15:13:44 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Hi All,
>> 
>> - This bug fix patch fixes a missing case during reverse[bits|bytes] identity transformation.
>> - Unlike AARCH64(SVE), X86(AVX512) ISA has no direct instruction to reverse[bits|bytes] of a vector lane hence a predicated operation is supported through blend instruction.
>> - New IR framework based tests has been added to test transforms relevant to AVX2, AVX512 and SVE.
>> 
>> Kindly review and share your feedback.
>> 
>> Best Regards,
>> Jatin
>
> Jatin Bhateja has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
> 
>  - Merge branch 'master' of http://github.com/openjdk/jdk into JDK-8287794
>  - 8287794: Review comments resolved.
>  - 8287794: Reverse*VNode::Identity problem

src/hotspot/share/opto/vectornode.cpp line 1859:

> 1857:   }
> 1858:   if (n->Opcode() == in1->Opcode()) {
> 1859:     // OperationV (OperationV X , MASK) , MASK =>  X

Code style, suggest to:

// (OperationV (OperationV X MASK) MASK) => X

test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java line 80:

> 78: 
> 79:     @Test
> 80:     @IR(applyIfCPUFeature={"sve", "true"}, failOn = {"ReverseBytesV" , " > 0 "})

Use "IRNode.REVERSE_BYTES_V" instead?

test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java line 118:

> 116: 
> 117:     @Test
> 118:     @IR(applyIfCPUFeatureOr={"sve", "true", "simd", "true", "avx2", "true"}, counts = {"ReverseBytesV" , " > 0 "})

Cpu feature "sve" contains "simd", so I think only keep `"simd", "true"` is fine.

test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java line 156:

> 154: 
> 155:     @Test
> 156:     @IR(applyIfCPUFeature={"sve", "true"}, failOn = {"ReverseBytesV" , " > 0 "})

Can we test the IR with x86 avx-512 predicated feature instead of "sve"? SVE is different that we also need to specify "-XX:UseSVE=1" to make sure the predicated feature enabled.

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

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


More information about the hotspot-compiler-dev mailing list