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

Damon Fenacci dfenacci at openjdk.org
Tue Jun 4 17:53:58 UTC 2024


On Mon, 3 Jun 2024 06:50:18 GMT, Gui Cao <gcao at openjdk.org> wrote:

> @dafedafe Hi Damon, Maybe you can take a look at this small change? Thanks.

@zifeihan you're right that the case with a vector length of 64 bits is not covered correctly.

I wouldn't fix it using different species depending on the length though. The Java Vector API explicitly says that not all shapes are supported by all platforms, and one should choose shape-agnostic code. Also, the IR framework uses the maximum vector size possible (if not explicitly set in the rules).
I'd rather make sure that masks are not the same for lengths of 1 (for long and double vectors): something like this `longMask[i] = L_SPECIES.length() > 1 && i % 2 == 0;` would probably do.
For long and double indices this cannot be done with length 1. So an option would be to change the asserts to add a check for the length, e.g. `Asserts.assertFalse(L_SPECIES.length() != 1 && res.equals(res2));`.
There is always the alternative of not running long and double vector tests with max vector lengths of 64.

Regarding `-XX:+IncrementalInlineForceCleanup`: this has been added because of the issue described in [JDK-8302459](https://bugs.openjdk.org/browse/JDK-8302459) that sometimes prevents C2 to properly vectorise (it should be removed when this issue is fixed). Having it there shouldn't really make any test fail though. If this is the case with `aarch64` it might mean that there is another issue somewhere else.

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

PR Comment: https://git.openjdk.org/jdk/pull/19473#issuecomment-2148091539


More information about the hotspot-compiler-dev mailing list