RFR: 8370863: VectorAPI: Optimize the VectorMaskCast chain in specific patterns [v8]

Emanuel Peter epeter at openjdk.org
Tue Jan 27 08:58:25 UTC 2026


On Tue, 27 Jan 2026 08:42:14 GMT, Eric Fang <erfang at openjdk.org> wrote:

>> src/hotspot/share/opto/vectornode.cpp line 1063:
>> 
>>> 1061:   return n;
>>> 1062: }
>>> 1063: 
>> 
>> This has a clear parallel in `Node::uncast`. But there, we may recursively uncast.
>> 
>> Your pattern:
>> `(VectorStoreMask (VectorMaskCast* (VectorLoadMask x))) => (x)`
>> 
>> We could also have a chain of casts here.
>> Can you explain why you chose only to do a single step here?
>
> I'm not sure I fully understood your point. This function can recursively uncast a chain of consecutive `VectorMaskCastNode`, so the pattern you mentioned above can be optimized to `(x)` even when there are multiple `VectorMaskCastNode` in between.
> 
> I’m not sure I get what you mean. Could you elaborate on it a bit? Thanks~

Woops, my bad. I read `if` instead of `while`. Sorry, you are right!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28313#discussion_r2730938160


More information about the hotspot-compiler-dev mailing list