RFR: 8370863: VectorAPI: Optimize the VectorMaskCast chain in specific patterns [v2]
Eric Fang
erfang at openjdk.org
Mon Dec 15 02:39:54 UTC 2025
On Fri, 12 Dec 2025 15:10:29 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Yeah it's already a static method. See https://github.com/openjdk/jdk/pull/28313/files#diff-ba9e2d10a50a01316946660ec9f68321eb864fd9c815616c10abbec39360efe5R141
>>
>> Or you mean a static method limited to this file ? If so, I prefer not, it may be used at other places. Thanks~
>
> Could you return a `VectorNode*`? And should the input not already be a `VectorNode*`?
Hi @eme64 thanks for your review. Here the design is as follows:
1. Any node can be used as the input to this function.
2. If the input node `n` is not a `VectorMaskCastNode`, then return `n` itself.
The advantage of this is that we don't need to check whether the parameter `n` is a `VectorNode` when calling `uncast_mask`. This check is necessary, for example, `n` might be a `PhiNode`, which is not a `VectorNode`.
Actually, this function could also be placed in the `Node` class, just like the `Node::uncast` function. However, I feel that this function is primarily used for vector nodes, and to avoid unnecessarily expanding its scope, I placed it in `VectorNode`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28313#discussion_r2617757865
More information about the hotspot-compiler-dev
mailing list