Integrated: 8357694: RISC-V: Several IR verification tests fail when vlen=128
Dingli Zhang
dzhang at openjdk.org
Mon Jul 21 13:38:49 UTC 2025
On Mon, 21 Jul 2025 02:30:03 GMT, Dingli Zhang <dzhang at openjdk.org> wrote:
> Hi,
> Can you help to review this patch? Thanks!
>
> These tests failed because with a vlen of 128, these tests generate vectors containing only two elements. However, 2-element reductions for INT/LONG are not profitable, so the compiler won't generate the corresponding reductions IR.
>
> We can refer to here:
> https://github.com/openjdk/jdk/blob/441dbde2c3c915ffd916e39a5b4a91df5620d7f3/src/hotspot/share/opto/superword.cpp#L1606-L1633
>
> According to the explanation above, when I use `-XX:+UnlockDiagnosticVMOptions -XX:AutoVectorizationOverrideProfitability=2`, these cases passed with vlen=128.
>
> We can fix this problem by adding the restriction of `MaxVectorSize` greater than or equal to 32 (256 bits) to these test cases.
>
> ## Test (fastdebug)
> ### Test on k1 and qemu (w/ RVV, vlen=128)
> - compiler/vectorization/runner/LoopReductionOpTest.java
> - compiler/c2/irTests/TestIfMinMax.java
> - compiler/loopopts/superword/RedTest_long.java
> - compiler/loopopts/superword/SumRed_Long.java
> - compiler/loopopts/superword/TestGeneralizedReductions.java
> - compiler/loopopts/superword/TestUnorderedReductionPartialVectorization.java
This pull request has now been integrated.
Changeset: 15b5b54a
Author: Dingli Zhang <dzhang at openjdk.org>
Committer: Hamlin Li <mli at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/15b5b54ac707ba0d4e473fd6eb02c38a8efe705c
Stats: 49 lines in 6 files changed: 36 ins; 0 del; 13 mod
8357694: RISC-V: Several IR verification tests fail when vlen=128
Reviewed-by: mhaessig, fyang, mli
-------------
PR: https://git.openjdk.org/jdk/pull/26408
More information about the hotspot-compiler-dev
mailing list