RFR: 8286941: Add mask IR for partial vector operations for ARM SVE [v3]
Xiaohong Gong
xgong at openjdk.org
Mon Jun 20 02:04:00 UTC 2022
On Mon, 20 Jun 2022 01:10:38 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
>> src/hotspot/share/opto/vectornode.cpp line 864:
>>
>>> 862: // Generate a vector mask for vector operation whose vector length is lower than the
>>> 863: // hardware supported max vector length.
>>> 864: if (vt->length_in_bytes() < MaxVectorSize) {
>>
>> For completeness, length comparison check can be done against MIN(SuperWordMaxVectorSize, MaxVectorSize).
>> Even though SuperWordMaxVector differs from MaxVectorSize only for certain X86 targets and this control flow is only executed for AARCH64 SVE targets currently.
>
> Yes, I agree with you to add the SuperWordMaxVectorSize reference. Thanks! I will change it.
I'm afraid that we cannot directly use `MIN(SuperWordMaxVectorSize, MaxVectorSize)` here. As I know `SuperWordMaxVectorSize` is used to control the max vector limit specially for auto-vectorization. It should not have any influence to the VectorAPI max vector size. So if the supported max vector size for VetorAPI is larger than auto-vectorization, the transformation will be influenced. For example, if a SVE hardware supported 128-bytes max vector size, but the `SuperWordMaxVectorSize` is 64, the predicate will not be generated for vectors whose vector size is smaller than 128-bytes. And I think x86 also has the similar issue. I think we'd better need a unit method to compute the `max_vector_size` that can handle the differences for superword and VectorAPI. And then all the orignal max_vector_size should be replaced with it. WDYT?
-------------
PR: https://git.openjdk.org/jdk/pull/9037
More information about the hotspot-compiler-dev
mailing list