RFR: 8357554: Enable vectorization of Bool -> CMove with different type size (on riscv)
Hamlin Li
mli at openjdk.org
Tue Nov 11 14:10:48 UTC 2025
On Tue, 11 Nov 2025 13:45:44 GMT, Galder Zamarreño <galder at openjdk.org> wrote:
>> Hi,
>>
>> Can you help to review this patch?
>>
>> This patch enables the vectorization of statement like `op_1 bop op_2 ? res_f_d_1 : res_f_d_2` in a loop, where op_x's size is different from res_f_d_x's.
>>
>> To assist with code review, this pr contains only the shared code change, is splitted from https://github.com/openjdk/jdk/pull/28230, which enable & implement the riscv part. The similar optimization could be extended to other platforms.
>>
>> ## Some background
>>
>> Previously, it's https://github.com/openjdk/jdk/pull/25336, which was blocked by unsigned comparison issue. The issue was recently resolved by https://github.com/openjdk/jdk/pull/27942, so I'm re-start working on this optimization.
>>
>> This pr only relaxes one of the constraints in https://github.com/openjdk/jdk/pull/25336, i.e. transform CMoveF/D to vector operations no matter what's the size of comparison's operator, but remove the optimization of transform CMoveI/L to vector operations which I think need more investigation.
>>
>> # Test
>> ## Jtreg
>>
>> in progress...
>>
>> ## Performance
>>
>> check the performance data in https://github.com/openjdk/jdk/pull/25341 on riscv.
>>
>> Thanks
>
> Sounds like this PR should include some IR tests?
@galderz @eme64
As this pr does not change any behaviour (it's splitted from https://github.com/openjdk/jdk/pull/28230, as suggested in previous review, check https://github.com/openjdk/jdk/pull/25341#issuecomment-2902440231 please), so the tests (jtreg & jmh) are put in https://github.com/openjdk/jdk/pull/28230.
Or should I just close this one and use https://github.com/openjdk/jdk/pull/28230 instead?
@galderz @eme64 BTW, there is an assert fix in this pr, which is also in another specific pr: https://github.com/openjdk/jdk/pull/28141. Please let me know if I should do it in this pr or not. Thanks!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28231#issuecomment-3517063624
PR Comment: https://git.openjdk.org/jdk/pull/28231#issuecomment-3517084408
More information about the hotspot-compiler-dev
mailing list