RFR: 8357694: RISC-V: Several IR verification tests fail when vlen=128 [v2]

Dingli Zhang dzhang at openjdk.org
Mon Jul 21 13:33:50 UTC 2025


On Mon, 21 Jul 2025 05:01:45 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
>
> Dingli Zhang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Apply fix only on RISC-V

Thanks all for the review!

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

PR Comment: https://git.openjdk.org/jdk/pull/26408#issuecomment-3096802885


More information about the hotspot-compiler-dev mailing list