RFR: 8356760: VectorAPI: Optimize VectorMask.fromLong for all-true/all-false cases [v3]

erifan duke at openjdk.org
Mon Jul 7 03:46:39 UTC 2025


On Fri, 4 Jul 2025 11:59:23 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

> What if during iterative GVN a constant -1 seeps through IR graph and gets connected to the input of VectorLongToMaskNode, you won't be able to create maskAll true in that case?

Yes, this PR doesn't support this case. Maybe we should do this optimization in `ideal`. If `VectorLongToMask` is not supported, then try to convert it to `maskAll` or `Replicate` in intrinsic.

> Do you see any advantage of doing this at intrinsic layer over entirely handling it in Java implimentation by simply modifying the opcode of fromBitsCoerced to MODE_BROADCAST from existing MODE_BITS_COERCED_LONG_TO_MASK for 0 or -1 input.

I had tried this method and gave it up, because it has up to 34% performance regression for specific cases on x64.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25793#discussion_r2188903923


More information about the hotspot-compiler-dev mailing list