[jdk20] RFR: 8299715: IR test: VectorGatherScatterTest.java fails with SVE randomly
Quan Anh Mai
qamai at openjdk.org
Tue Jan 10 04:14:03 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
IIUC the API will generate a check even if the hardware supports the masked operation. I believe this is less efficient, we should fall back to a check and an unmasked operation in the optimistic cases only if the masked operation is not supported.
Thanks.
-------------
PR: https://git.openjdk.org/jdk20/pull/90
More information about the hotspot-compiler-dev
mailing list