RFR: 8357694: RISC-V: Several IR verification tests fail when vlen=128
Fei Yang
fyang at openjdk.org
Mon Jul 21 04:17:44 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
test/hotspot/jtreg/compiler/c2/irTests/TestIfMinMax.java line 298:
> 296:
> 297: @Test
> 298: @IR(applyIfAnd = { "SuperWordReductions", "true", "MaxVectorSize", ">=32" },
Maybe we should only add this new requirement for RVV? Seems that it is not needed for avx512.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26408#discussion_r2218149766
More information about the hotspot-compiler-dev
mailing list