RFR: 8357694: RISC-V: Several IR verification tests fail when vlen=128 [v2]
Dingli Zhang
dzhang at openjdk.org
Mon Jul 21 05:01:45 UTC 2025
> 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
Dingli Zhang has updated the pull request incrementally with one additional commit since the last revision:
Apply fix only on RISC-V
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/26408/files
- new: https://git.openjdk.org/jdk/pull/26408/files/611a0d85..43815f2f
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=26408&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=26408&range=00-01
Stats: 44 lines in 4 files changed: 29 ins; 0 del; 15 mod
Patch: https://git.openjdk.org/jdk/pull/26408.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/26408/head:pull/26408
PR: https://git.openjdk.org/jdk/pull/26408
More information about the hotspot-compiler-dev
mailing list