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

Jatin Bhateja jbhateja at openjdk.org
Mon Jul 25 05:29:09 UTC 2022


On Mon, 25 Jul 2022 04:00:10 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> Jatin Bhateja has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8287794: Review comments resolved.
>
> src/hotspot/share/opto/vectornode.cpp line 1857:
> 
>> 1855:   if (n->is_predicated_using_blend()) {
>> 1856:     return n;
>> 1857:   }
> 
> The change in this patch looks fine to me! Just a concern the previous codes, for patterns like:
> 
> VectorBlend X (ReverseBytesV (ReverseBytesV Y)) MASK
> 
> we will miss the transformation to:
> 
> VectorBlend X Y MASK
> 
> right? Thanks!

No, since the flag Predicated_with_blend is set over nodes if operation itself is predicated, here both ReverseBytesV nodes are non-predicated ones and this check is part of identity routines of reverse* operations.

> test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java line 80:
> 
>> 78: 
>> 79:     @Test
>> 80:     @IR(applyIfCPUFeature={"sve", "true"}, failOn = {"ReverseBytesV" , " > 0 "})
> 
> Use " failOn = "ReverseBytesV" " instead?

Thanks for noticing this, semantically, failOn NODE is same as failOn NODE , "> 0", tried and tested it, but it looks like a non-standard usage of the option.

> test/hotspot/jtreg/compiler/vectorapi/TestReverseByteTransforms.java line 99:
> 
>> 97: 
>> 98:     @Test
>> 99:     @IR(applyIfCPUFeatureOr={"sve", "true", "simd", "true", "avx2", "true"}, counts = {"ReverseBytesV" , " > 0 "})
> 
> After https://github.com/openjdk/jdk/pull/9509 merged, I think we'd better to consider different vm flags like "UseAVX", "UseSVE" for each architecture. For example, if the cpu feature mathes "sve", but user may set "-XX:UseSVE=0". With such options, this IR test will also run and I'm afraid it will fail with "-XX:UseSVE=0".

CPU features list is populated during VM startup, this list is later ON queried by applyIfCPUFeature during IR validations, I do not think UseSVE is a valid flag for X86, 


SPROMPT>java -XX:UseSVE=0
Unrecognized VM option 'UseSVE=0'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
SPROMPT>lscpu
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          72
On-line CPU(s) list:             0-71
Thread(s) per core:              2
Core(s) per socket:              18
Socket(s):                       2
NUMA node(s):                    2
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           85
Model name:                      Intel(R) Xeon(R) Gold 6139 CPU @ 2.30GHz

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

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


More information about the hotspot-compiler-dev mailing list