[jdk20] RFR: 8299715: IR test: VectorGatherScatterTest.java fails with SVE randomly

Tobias Hartmann thartmann at openjdk.org
Tue Jan 10 14:14:01 UTC 2023


On Mon, 9 Jan 2023 08:08:02 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

> The IR check fails randomly on two unit tests: `"testLoadGatherMasked"`
> and `"testStoreScatterMasked"`. The two tests call the vector mask
> controlled load_gather/store_scatter vector APIs, and the compiler
> will generate the` "LoadVectorGatherMasked"`/`"StoreVectorScatterMasked"`
> IR normally if the corresponding API is intrinsified successfully.
> So for normal cases, the following IR check can success:
> 
> 
>   @IR(counts = { IRNode.LOAD_VECTOR_GATHER_MASKED, ">= 1" })
> 
> 
> But if all the lane values in the vector mask are true, the masked
> API will be implemented with the corresponding un-masked API instead
> (see the masked load gather API implementation [1]). And the C2 compiler
> generates the un-masked IRs, i.e. `"LoadVectorGather"`/`"StoreVectorScatter"`.
> For such cases, the above IR check will fail.
> 
> To make sure the masked load_gather/store_scatter IR is generated by
> C2 compiler, we have to modify the mask input in the test to make sure
> the vector mask is not alltrue.
> 
> [1] https://github.com/openjdk/jdk/blob/master/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java#L2931

Looks good to me.

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

Marked as reviewed by thartmann (Reviewer).

PR: https://git.openjdk.org/jdk20/pull/90


More information about the hotspot-compiler-dev mailing list