RFR: 8342095: Add autovectorizer support for subword vector casts [v16]

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Wed Jan 28 04:33:03 UTC 2026


On Tue, 27 Jan 2026 16:09:36 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Jasmine Karthikeyan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Apply changes from review
>
> src/hotspot/share/opto/vectornode.cpp line 1540:
> 
>> 1538: 
>> 1539:   // Opcode is only required to disambiguate half float, so we pass -1 as it can't be encountered here.
>> 1540:   return (is_subword_type(def_bt) || is_subword_type(use_bt)) && VectorCastNode::implemented(-1, pack_size, def_bt, use_bt);
> 
> Why do we specifically require it to be a subword. If you mean this is only called with one of the two being a subword then can we use an assert instead?

@merykitty Since this function is called from places that may not always have a subword type, changing it to an assert causes spurious assertion failures.

@iwanowww Scalar int<->long conversions are modeled with `ConvI2L` and `ConvL2I`, the existing superword mechanism is able to vectorize the conversion without needing to dynamically add new nodes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23413#discussion_r2734803318


More information about the hotspot-compiler-dev mailing list