RFR: 8357554: Enable vectorization of Bool -> CMove with different type size (on riscv) [v3]
Emanuel Peter
epeter at openjdk.org
Tue Nov 11 14:56:51 UTC 2025
On Tue, 11 Nov 2025 14:07:10 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> 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. :)
Except that I typed in haste, and now you have a syntax error, sorry about that :/
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28231#discussion_r2514529522
More information about the hotspot-compiler-dev
mailing list