[vectorIntrinsics+mask] RFR: 8269343: Masked vector arithmetic intrinsics failed to be inlined randomly

Paul Sandoz psandoz at openjdk.java.net
Mon Jun 28 18:58:56 UTC 2021


On Fri, 25 Jun 2021 09:29:58 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

> The masked `"lanewise/reduceLanes"` failed to be intrinsified randomly. The main reason is the hotspot c2 compiler cannot
> unbox the mask value due to the expected vector box type being mismatched with the class of the mask value. The vector box type is the` "mask class"` which is specified in Java level and saved in the intrinsic argument list. It is the class of the instance
> of the vector mask (i.e. `"IntMaxMask.class"`), while the type of mask value is the super class (i.e. `"jdk.incubator.vector.VectorMask<Integer>"`).
> 
> Casting the mask value to the same subclass before calling the intrinsics can solve this issue.

Looks good.

I am wondering why its not needed on the vector arguments, is that because there is a cast to `{T}Vector` for vector arguments in templates is sufficient in those cases? Or does the `that.check(this);` help as well?

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

Marked as reviewed by psandoz (Committer).

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


More information about the panama-dev mailing list