[vectorIntrinsics+mask] RFR: 8266287: Basic mask IR implementation for the Vector API masking feature support [v2]

Xiaohong Gong xgong at openjdk.java.net
Thu Jun 24 06:13:43 UTC 2021


On Mon, 21 Jun 2021 09:53:49 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> Xiaohong Gong has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
>> 
>>  - Use "Flag_is_predicated_vector" for masked vector nodes
>>  - Merge branch 'vectorIntrinsics+mask'
>>  - 8266287: Basic mask IR implementation for the Vector API masking feature support
>
> Hi there, the new commit refines the C2 compiler IRs for vector mask. The main idea is trying to use the same nodes but with
> different types (i.e. use `"TypeVectMask"` for SVE/AVX-512, while `"TypeVect"` for others). It doesn't need to create new IRs specially for SVE/AVX-512 predicate type. The `"idea_reg"` is decided by the type of the node, so that the compiler can choose the right register for vector mask during codegen.
> 
> For more details, the following existed IRs are kept to use normally:
> 
>  - fromArray: LoadVector + VectorLoadMask
>  - compare:   VectorMaskCmp
>  - others:    VectorMaskCast
> 
> And to spearate the IRs for vector and vector mask, the following mask IRs are added:
> 
>  - maskAll:    MaskAll
>  - and/or/xor: AndVMask/OrVMask/XorVMask
> 
> Further more, to improve the performance of vector mask loading/storing with SVE, the following transformations are also kept:
> 
>  - fromArray:
>      LoadVector + VectorLoadMask    ==>  LoadVectorMask
>  - intoArray:
>      VectorStoreMask + StoreVector  ==>  StoreVectorMask
> 
> 
> Any feedback is welcome! Thanks so much!
> 
> Best Regards,
> Xiaohong

> Hi @XiaohongGong , I just missed noticing this query earlier, apologies!, I think VectorLoadMask and VectorStoreMask serves the purpose to load/store a raw mask (boolean array) from/to a vector/predicated register. An explicit mask casting IR (VectorMaskCastNode) has been introduced recently which can be plugged after loading mask value if casting is needed.

It's ok. I think it's ok to use `VectorMaskCastNode` (actually we think this node is more reasonable instead of `VectorLoadMask/VectorStoreMask`). It needs a further consideration for it since we'd better to revisit its usage for all platforms while not only SVE.

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

PR: https://git.openjdk.java.net/panama-vector/pull/78


More information about the panama-dev mailing list