RFR: 8374349: [VectorAPI]: AArch64: Prefer merging mode SVE CPY instruction

Eric Fang erfang at openjdk.org
Fri Jan 23 02:11:31 UTC 2026


On Thu, 22 Jan 2026 17:59:04 GMT, Andrew Haley <aph at openjdk.org> wrote:

> Can we do without `PreferSVEMergingModeCPY`?

Thanks, @theRealAph. That’s a fair question – in general, fewer options are definitely preferable.

For this change, the main reason I introduced `PreferSVEMergingModeCPY` as an Arch-level flag is that the benefit and trade-offs of using the merging-mode sequence can be quite **microarchitecture-dependent**. At the moment, I’ve only been able to systematically evaluate it on `Neoverse V1/V2`, where the optimization is consistently neutral or positive in our VectorMask-related benchmarks, so it feels safe to keep it enabled by default there. On other AArch64 SVE implementations, we don’t yet have the same level of data. Keeping this knob gives us two advantages:

1. It provides a simple, low-friction escape hatch if some future core shows an unexpected regression with the merging-mode sequence.
2. It allows us (or downstream distributions) to selectively enable/disable the optimization per platform without needing to change the generated code shape again.

>From a user’s point of view, the default behaviour should still be sensible: the option is enabled by default on `Neoverse V1/V2`, where we’ve confirmed the improvement, and disabled elsewhere. If, over time, we gain enough confidence that the merging-mode sequence is strictly preferable across a wider range of hardware, I’m happy to follow up with a separate change to hard-wire the behaviour and drop the flag.

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

PR Comment: https://git.openjdk.org/jdk/pull/29359#issuecomment-3787782499


More information about the hotspot-dev mailing list