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

Xiaohong Gong xgong at openjdk.java.net
Thu Jul 1 02:02:18 UTC 2021


On Thu, 24 Jun 2021 06:11:07 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> 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.

> @XiaohongGong Please go ahead and integrate the code so we can proceed with the work.
> It will be good to file JBS entries to revisit StoreVectorMask/LoadVectorMask and OrVMask/AndVMask/XorVMask creation.

OK. Agree! I will do a merge since there are some conflicts again. Thanks!

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

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


More information about the panama-dev mailing list