Vector API: VectorMask.fromLong is not intrinsified
Jakub Okoński
jakub at okonski.org
Sat Oct 12 21:25:40 UTC 2024
Hi,
I noticed that the following code doesn't get intrinsified:
VectorMask.fromLong(ByteVector.SPECIES_128, someInt)
Profiling with JFR reveals that this method falls back to fromArray and
allocates a boolean[], which is undesirable.
It has to be this fallback code:
https://github.com/openjdk/jdk/blob/41ee582df8c65f2f26b21e46784cf0bc4ece0585/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorMask.java#L252
With PrintIntrin, I'm seeing this message
** missing constant: vclass=DecodeN etype=ConP vlen=LoadI bitwise=ConI
I modified the logging and narrowed it down to vector_klass->const_oop()
being a nullptr
https://github.com/openjdk/jdk/blob/41ee582df8c65f2f26b21e46784cf0bc4ece0585/src/hotspot/share/opto/vectorIntrinsics.cpp#L833
I then tried to cheat and hardcode the vector class and lane count in
VectorMask.java so it knows the arguments statically, like so:
return VectorSupport.fromBitsCoerced((Class<? extends
AbstractMask<E>>) (Class<?>) Byte128Vector.Byte128Mask.class,
vsp.elementType(), 16, bits, ...
While this did make inlining happen (as reported by PrintIntrin at least),
I couldn't get rid of the boolean[] allocations.
I'm testing on 41ee582df8c65f2f26b21e46784cf0bc4ece0585 amd64 Linux.
Regards,
Jakub
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20241012/504840d2/attachment.htm>
More information about the panama-dev
mailing list