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

Xiaohong Gong xgong at openjdk.org
Mon Jan 9 14:21:42 UTC 2023


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

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

Commit messages:
 - 8299715: IR test: VectorGatherScatterTest.java fails with SVE randomly

Changes: https://git.openjdk.org/jdk20/pull/90/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk20&pr=90&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8299715
  Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk20/pull/90.diff
  Fetch: git fetch https://git.openjdk.org/jdk20 pull/90/head:pull/90

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


More information about the hotspot-compiler-dev mailing list