RFR: 8357554: Enable vectorization of Bool -> CMove with different type size (on riscv) [v2]
Hamlin Li
mli at openjdk.org
Tue Nov 11 14:10:51 UTC 2025
On Tue, 11 Nov 2025 13:51:01 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update src/hotspot/share/opto/superword.cpp
>>
>> refactor `is_velt_basic_type_compatible_use_def`
>>
>> Co-authored-by: Emanuel Peter <emanuel.peter at oracle.com>
>
> src/hotspot/share/opto/superword.cpp line 2339:
>
>> 2337: } else if (VectorNode::is_different_use_def_size_supported()) {
>> 2338: return use->is_CMove() && def->is_Bool();
>> 2339: }
>
> This looks a little tangled, and harder to extend. Can we make it linear like this?
>
> Suggestion:
>
> // Input size of use equals output size of def
> if (type2aelembytes(use_bt) == type2aelembytes(def_bt)) {
> return true;
> }
>
> // Allow CMove to have different type for comparision and moving.
> if (VectorNode::is_different_use_def_size_supported() && return use->is_CMove() && def->is_Bool()) {
> return true;
> }
>
> Because what if `is_different_use_def_size_supported` is true, but we don't have a CMove case, and then we would be able to go on with yet something else below later on?
Sure, I just committed a change as you suggested via github. :)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28231#discussion_r2514371052
More information about the hotspot-compiler-dev
mailing list