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

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


On Tue, 29 Jun 2021 10:07:13 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>>> There could be a problem during scalarize_vbox_node if vector type of mask VectorBoxNode is made as TypeVectMask
>> https://github.com/jatin-bhateja/panama-vector/blob/628dc716b3f171e1b7b62fd1ec452a3d14a04af9/src/hotspot/share/opto/vector.cpp#L212
>> 
>> I think the main issues that I met are related to `VectorUnboxNode` while not `VectorBoxNode`.  BTW, the bottom type of `VectorBoxNode` is the box type while not the vector type. I'm sorry that I cannot see the influence whether the vector type is a `TypeVect` or `TypeVectMask` for it. Could you please kindly elaborate more about this? 
>> 
>> From my side, setting the `TypeVect` to `VectorBoxNode` might be ok, but how about the `VectorUnboxNode` ? I think they should keep the same with each other?
>
> I agree with you on this. It seems that as long as both vector_type of VectorBoxNode and type of VectorUnboxNode comply it should not lead to any issue. 
> May be one can directly pass the type of the vector being boxed instead of creating a new type during box creation.
> 
> 
> diff --git a/src/hotspot/share/opto/vectorIntrinsics.cpp b/src/hotspot/share/opto/vectorIntrinsics.cpp
> index 940e87b97ad..d1d0e6f5f24 100644
> --- a/src/hotspot/share/opto/vectorIntrinsics.cpp
> +++ b/src/hotspot/share/opto/vectorIntrinsics.cpp
> @@ -73,8 +73,7 @@ Node* GraphKit::box_vector(Node* vector, const TypeInstPtr* vbox_type, BasicType
>    Node* ret = gvn().transform(new ProjNode(alloc, TypeFunc::Parms));
> 
>    assert(check_vbox(vbox_type), "");
> -  const TypeVect* vt = TypeVect::make(elem_bt, num_elem);
> -  VectorBoxNode* vbox = new VectorBoxNode(C, ret, vector, vbox_type, vt);
> +  VectorBoxNode* vbox = new VectorBoxNode(C, ret, vector, vbox_type, vector->bottom_type()->is_vect());
>    return gvn().transform(vbox);
>  }

Yeah, thanks for the suggestion! Like what you suggested for this PR, maybe we can revisit this part as well in future if it needs any enhancement!

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

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


More information about the panama-dev mailing list