RFR: 8264954: unified handling for VectorMask object re-materialization during de-optimization [v2]
vlivanov at openjdk.java.net
Mon Apr 12 15:04:39 UTC 2021
On Mon, 12 Apr 2021 08:16:13 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
> In addition to bt != T_BOOLEAN check, we also need to check if type is a vectormask (explicit type added for mask generating nodes on targets supporting predicate registers).
You check here that the mask is in canonical representation (which is a vector of booleans) before applying the canonicalizing conversion. Alternatively, you could check that the mask is in "native"/platform-dependent representation (`vec_value` has `TypeVectMask` type).
So, my reading of your response is that `bt != T_BOOLEAN` check is not enough to reliably distinguish between the representations: a mask for vector of booleans (in native representation) will have the same type as the vector of booleans produced by the canonicalizing cast of a mask value. I agree with that.
But until `TypeVectMask` is used uniformly and independently of predicate register support, `TypeVect` vs `TypeVectMask` doesn't cut the problem as well. And adding `bt != T_BOOLEAN` doesn't help.
So, I'm fine with leaving the Opcode check for now.
In the longer term, we need to come up with a uniform representation in type system for masks in native format to be able to reliably distinguish between masks and vectors in cross-platform manner.
More information about the hotspot-compiler-dev