RFR: 8286941: Add mask IR for partial vector operations for ARM SVE [v3]

Jatin Bhateja jbhateja at openjdk.org
Mon Jun 20 03:15:47 UTC 2022


On Mon, 20 Jun 2022 02:16:31 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> 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?
>
> BTW, the max vector size used here should be referenced from the hardware supported max vector size, which should be `MaxVectorSize` for SVE. For those vectors whose vector size is `SuperWordMaxVectorSize`, but smaller than the hardware supported max size, we still need to generate a predicate for them to make sure the results are right. So using `MaxVectorSize` is necessary here.

VectorNode::try_to_gen_masked_vector is a common routine which will get called during idealization of all the child vector nodes (generated either by autovectorizer or vectorAPI) unless child overrides its ideal routine.

Will this not result into out of memory writes for storeVector since autovectorizer works under influence of SuperWordMaxVectorSize which could be less than MaxVecotSize but your mask computation is  only considering MaxVectorSize, hence may generate wider masks than desired.

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

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


More information about the hotspot-compiler-dev mailing list