[vectorIntrinsics+mask] RFR: 8266287: Basic mask IR implementation for the Vector API masking feature support [v3]
Jatin Bhateja
jbhateja at openjdk.java.net
Tue Jun 22 09:41:44 UTC 2021
On Mon, 21 Jun 2021 03:28:19 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
>> VectorBoxNode and VectorUnboxNode are macro nodes and carry the vector type which comply with the species i.e. for IntVector.SPECIES_256, vector type of Box/Unbox should be TypeVect(T_INT,8), both these nodes needs to be expanded as per following expansion rules:-
>>
>> a) VectorBox mask(TypeVectMask) ====> VectorStoreMask + StoreVector.
>> b) VectorUnbox mask =====> LoadVector + VectorLoadMask (TypeVectMask)
>> c) VectorUnbox (VectorBox mask) ====> VectorStoreMask(TypeVectMask) + StoreVector + LoadVector + VectorLoadMask(TypeVectMask)
>>
>> An optimization over VectorUnboxNode should consult the type of VectorBoxNode and vice-versa, similarly any optimization involving VectorLoadMaskNode should comply with type of VectoStoreMaskNode, there cannot be a mix-match, if there is any such case it needs to be fixed like the following handling
>> https://github.com/openjdk/panama-vector/pull/90#pullrequestreview-679559503
>>
>> Can you kindly share the tests which failed.
>
> Hi @jatin-bhateja , too much Vector API jtreg tests crashes due to this change. Please see one of the jvm crash log here: http://cr.openjdk.java.net/~xgong/rfr/mask/crashes.
>
> BTW, I remember @iwanowww said that the vector type should match for `VectorUnbox ` and its `obj ` when I fixed the type mismatching issue for vector mask with floating point type before. Please see the comment here: https://github.com/openjdk/jdk/pull/3238#issuecomment-815036103
Hi @XiaohongGong ,
I made following changes in unbox and box creation routines and did not find any crashes as reposted in any of VectorAPI jtreg over AVX-512 platform.
diff --git a/src/hotspot/share/opto/vectorIntrinsics.cpp b/src/hotspot/share/opto/vectorIntrinsics.cpp
index 21e238afb5b..76553c9f2c9 100644
--- a/src/hotspot/share/opto/vectorIntrinsics.cpp
+++ b/src/hotspot/share/opto/vectorIntrinsics.cpp
@@ -81,7 +81,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, is_vector_mask(vbox_type->klass()));
+ const TypeVect* vt = TypeVect::make(elem_bt, num_elem);
VectorBoxNode* vbox = new VectorBoxNode(C, ret, vector, vbox_type, vt);
return gvn().transform(vbox);
}
@@ -96,7 +96,7 @@ Node* GraphKit::unbox_vector(Node* v, const TypeInstPtr* vbox_type, BasicType el
return NULL; // no nulls are allowed
}
assert(check_vbox(vbox_type), "");
- const TypeVect* vt = TypeVect::make(elem_bt, num_elem, is_vector_mask(vbox_type->klass()));
+ const TypeVect* vt = TypeVect::make(elem_bt, num_elem);
Node* unbox = gvn().transform(new VectorUnboxNode(C, vt, v, merged_memory(), shuffle_to_vector));
return unbox;
}
Can you kindly share a exact re-producer.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/78
More information about the panama-dev
mailing list