RFR: 8333248: VectorGatherMaskFoldingTest.java failed when maximum vector bits is 64 [v2]

Damon Fenacci dfenacci at openjdk.org
Wed Jun 5 14:52:01 UTC 2024


On Wed, 5 Jun 2024 08:22:25 GMT, Gui Cao <gcao at openjdk.org> wrote:

>> Hi, VectorGatherMaskFoldingTest.java Test fails when max vector bits is 64, when max vector bits is 64, LongVector.SPECIES_MAX.length() and DoubleVector.SPECIES_MAX.length() is 1. 
>> 
>> We can reproduce this problem in two ways:
>> 1. We can use riscv without rvv1.0 board to reproduce this problem
>> 2. Run VectorGatherMaskFoldingTest.java on aarch64 client mode without `-XX:+IncrementalInlineForceCleanup` Option,  the `-XX:+IncrementalInlineForceCleanup` is C2 Option, so we need to remove this Option from the VectorGatherMaskFoldingTest.main method. error message:
>> 
>> Base Test: @Test testDoubleVectorStoreLoadMaskedVector:
>> compiler.lib.ir_framework.shared.TestRunException: There was an error while invoking @Test method public static void compiler.vectorapi.VectorGatherMaskFoldingTest.testDoubleVectorStoreLoadMaskedVector(). Target: null. Arguments: <void>
>> 	at compiler.lib.ir_framework.test.BaseTest.invokeTestMethod(BaseTest.java:84)
>> 	at compiler.lib.ir_framework.test.BaseTest.invokeTest(BaseTest.java:71)
>> 	at compiler.lib.ir_framework.test.AbstractTest.run(AbstractTest.java:98)
>> 	at compiler.lib.ir_framework.test.TestVM.runTests(TestVM.java:861)
>> 	at compiler.lib.ir_framework.test.TestVM.start(TestVM.java:252)
>> 	at compiler.lib.ir_framework.test.TestVM.main(TestVM.java:165)
>> Caused by: java.lang.reflect.InvocationTargetException
>> 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
>> 	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
>> 	at compiler.lib.ir_framework.test.BaseTest.invokeTestMethod(BaseTest.java:80)
>> 	... 5 more
>> Caused by: java.lang.RuntimeException: assertNotEquals: expected [1.0] to not equal [1.0]
>> 	at jdk.test.lib.Asserts.fail(Asserts.java:691)
>> 	at jdk.test.lib.Asserts.assertNotEquals(Asserts.java:451)
>> 	at jdk.test.lib.Asserts.assertNotEquals(Asserts.java:435)
>> 	at compiler.vectorapi.VectorGatherMaskFoldingTest.testDoubleVectorStoreLoadMaskedVector(VectorGatherMaskFoldingTest.java:1089)
>> 	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>> 	... 7 more
>> 
>> 
>> For example, the following method will be failed:
>> 
>>     private static final VectorSpecies<Long> L_SPECIES = LongVector.SPECIES_MAX;
>>     private static final VectorSpecies<Double> D_SPECIES = DoubleVector.SPECIES_MAX;
>>     ...
>>     @Test
>>     @IR(counts = { IRNode.STORE_VECTOR_MASKED, ">= 1", IRNode.LOAD_VECTOR_MASKED, ">= 1" }, apply...
>
> Gui Cao has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix for Damon comment

On the other hand you might need to add the check here:
https://github.com/openjdk/jdk/blob/1235a453eef4a838fe07009b0c5e8a962b527bb4/test/hotspot/jtreg/compiler/vectorapi/VectorGatherMaskFoldingTest.java#L966
and here:
https://github.com/openjdk/jdk/blob/1235a453eef4a838fe07009b0c5e8a962b527bb4/test/hotspot/jtreg/compiler/vectorapi/VectorGatherMaskFoldingTest.java#L1098

test/hotspot/jtreg/compiler/vectorapi/VectorGatherMaskFoldingTest.java line 163:

> 161:         LongVector res = LongVector.fromArray(L_SPECIES, longArray, 0, longIndices, 0);
> 162:         LongVector res2 = LongVector.fromArray(L_SPECIES, longArray2, 0, longIndices, 0);
> 163:         Asserts.assertFalse(L_SPECIES.length() != 1 && res.equals(res2));

I think you don't need this change (`longArray` and `longArray2` are different even with length 1).

test/hotspot/jtreg/compiler/vectorapi/VectorGatherMaskFoldingTest.java line 227:

> 225:         LongVector res = LongVector.fromArray(L_SPECIES, longArray, 0, longIndices, 0, longVectorMask);
> 226:         LongVector res2 = LongVector.fromArray(L_SPECIES, longArray, 0, longIndices, 0, longVectorMask2);
> 227:         Asserts.assertFalse(L_SPECIES.length() != 1 && res.equals(res2));

You don't need this change either (`longVectorMask` and `longVectorMask` are different even with length 1).

test/hotspot/jtreg/compiler/vectorapi/VectorGatherMaskFoldingTest.java line 329:

> 327:         DoubleVector res = DoubleVector.fromArray(D_SPECIES, doubleArray, 0, doubleIndices, 0);
> 328:         DoubleVector res2 = DoubleVector.fromArray(D_SPECIES, doubleArray2, 0, doubleIndices, 0);
> 329:         Asserts.assertFalse(D_SPECIES.length() != 1 && res.equals(res2));

Same here.

test/hotspot/jtreg/compiler/vectorapi/VectorGatherMaskFoldingTest.java line 393:

> 391:         DoubleVector res = DoubleVector.fromArray(D_SPECIES, doubleArray, 0, doubleIndices, 0, doubleVectorMask);
> 392:         DoubleVector res2 = DoubleVector.fromArray(D_SPECIES, doubleArray, 0, doubleIndices, 0, doubleVectorMask2);
> 393:         Asserts.assertFalse(D_SPECIES.length() != 1 && res.equals(res2));

Same here.

test/hotspot/jtreg/compiler/vectorapi/VectorGatherMaskFoldingTest.java line 579:

> 577:         longVector.intoArray(res, 0, longIndices, 0, longVectorMask);
> 578:         longVector.intoArray(res2, 0, longIndices, 0, longVectorMask2);
> 579:         Asserts.assertFalse(L_SPECIES.length() != 1 && Arrays.equals(res, res2));

Same here.

test/hotspot/jtreg/compiler/vectorapi/VectorGatherMaskFoldingTest.java line 705:

> 703:         doubleVector.intoArray(res, 0, doubleIndices, 0);
> 704:         doubleVector2.intoArray(res2, 0, doubleIndices, 0);
> 705:         Asserts.assertFalse(D_SPECIES.length() != 1 && Arrays.equals(res, res2));

Same here.

test/hotspot/jtreg/compiler/vectorapi/VectorGatherMaskFoldingTest.java line 785:

> 783:         doubleVector.intoArray(res, 0, doubleIndices, 0, doubleVectorMask);
> 784:         doubleVector.intoArray(res2, 0, doubleIndices, 0, doubleVectorMask2);
> 785:         Asserts.assertFalse(D_SPECIES.length() != 1 && Arrays.equals(res, res2));

Same here.

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

PR Review: https://git.openjdk.org/jdk/pull/19473#pullrequestreview-2099417323
PR Review Comment: https://git.openjdk.org/jdk/pull/19473#discussion_r1627914309
PR Review Comment: https://git.openjdk.org/jdk/pull/19473#discussion_r1627914948
PR Review Comment: https://git.openjdk.org/jdk/pull/19473#discussion_r1627915692
PR Review Comment: https://git.openjdk.org/jdk/pull/19473#discussion_r1627916442
PR Review Comment: https://git.openjdk.org/jdk/pull/19473#discussion_r1627917053
PR Review Comment: https://git.openjdk.org/jdk/pull/19473#discussion_r1627917544
PR Review Comment: https://git.openjdk.org/jdk/pull/19473#discussion_r1627918103


More information about the hotspot-compiler-dev mailing list