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

Jatin Bhateja jbhateja at openjdk.org
Fri Jul 11 06:57:38 UTC 2025


On Thu, 10 Jul 2025 08:06:18 GMT, erifan <duke at openjdk.org> wrote:

> OK. But in order to cover various cases, the implementation may be a bit troublesome. The solution I thought of is to **check whether the architecture supports VectorLongToMask, MaskAll and Replicate in `LibraryCallKit::inline_vector_frombits_coerced`. If it does, generate VectorLongToMask, and then convert it to MaskAll or Replicate in IGVN**. This is similar to the current implementation of vector rotate.
> 
> At the same time, this conversion may affect some other optimizations, such as `VectorMaskToLong(VectorLongToMask (x)) => x` and `VectorStoreMask(VectorLoadMask (x)) => x`. So we also need to fix these effects.

For completeness, we should handle maskAll in the Identity transform of VectorMaskToLongNode.

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

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


More information about the hotspot-compiler-dev mailing list