Normally, the "VectorUnbox (VectorBox v)" can be optimized to "v" if their types are equal. And when unboxing vector mask, if their bottom_type is not equal, the VectorUnbox/VectorBox can also be eliminated by applying "VectorUnbox (VectorBox vmask) ==> VectorLoadMask (VectorStoreMask vmask)".
However, since some Vector APIs define different element type for floating point VectorMask (i.e. the logical APIs and "maskAll" use "long/int" as the element type, while others use "double/float"), the vector box/unbox types can be different for "VectorUnbox (VectorBox vmask)". The compiler will optimize it to "VectorLoadMask (VectorStoreMask vmask)". This is unnecessary and it can be optimized to "vmask", since double/float and long/int is the same for VectorMask.
However, since some Vector APIs define different element type for floating point VectorMask (i.e. the logical APIs and "maskAll" use "long/int" as the element type, while others use "double/float"), the vector box/unbox types can be different for "VectorUnbox (VectorBox vmask)". The compiler will optimize it to "VectorLoadMask (VectorStoreMask vmask)". This is unnecessary and it can be optimized to "vmask", since double/float and long/int is the same for VectorMask.
- relates to
-
JDK-8265816 Handle new VectorMaskCast node for x86
-
- Resolved
-