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

Xiaohong Gong xgong at openjdk.java.net
Mon Jun 21 03:31:53 UTC 2021


On Thu, 17 Jun 2021 19:29:28 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Hi @jatin-bhateja , it seems the type of `VectorBox/VectorUnbox` should be exactly matched with the `value` boxed. For such an optimization `// VectorUnbox (VectorBox v) ==> v`, if the type of `v` is a vector mask type while the `VectorUnbox` type is expected to be a vector type, the final result of this optimization would change the result type of `VectorUnbox` to be a mask type. Some type checks or assertion will fail. I met the following issue when I run the jtreg tests after changing type of `VectorBox/VectorUnbox` back to vector type:
>> 
>> # A fatal error has been detected by the Java Runtime Environment:
>> #
>> #  Internal Error (/home/ent-user/panama-vector/src/hotspot/share/opto/type.cpp:2412), pid=433543, tid=433698
>> #  Error: assert(base() == v->base()) failed
>> #
>> # JRE version: OpenJDK Runtime Environment (17.0) (fastdebug build 17-internal+0-git-8123588d66)
>> # Java VM: OpenJDK 64-Bit Server VM (fastdebug 17-internal+0-git-8123588d66, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
>> # Problematic frame:
>> # V  [libjvm.so+0x19f3108]  TypeVect::xmeet(Type const*) const+0x138
>> #
>> # Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" (or dumping to /home/ent-user/jtreg/jtreg-hg/build/images/jtreg/jtwork/scratch/2/core.433543)
>> #
>> # If you would like to submit a bug report, please visit:
>> #   https://bugreport.java.com/bugreport/crash.jsp
>> 
>> Do you have any strong reason that we must define a vector type for `VectorBox/VectorUnbox`?
>
> 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

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

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


More information about the panama-dev mailing list