RFR: 8351016: RA support for EVEX to REX/REX2 demotion to optimize NDD instructions

Jatin Bhateja jbhateja at openjdk.org
Mon Aug 4 15:52:29 UTC 2025


On Mon, 14 Jul 2025 12:35:19 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

> This may also be applicable to non-APX instructions. For example, in the case of casting long to int, if the destination and the source are the same, then we do not need to emit any code. As a result, do you think it is better to mark operands in the ad file to preferably have the same register as the result?

Yes, for now, I limited this to APX, but biasing the allocation of destination to non-interfering use(src) will enable instruction elision during assembling. Currently, while assigning a color(reg) to a live range, the allocator picks the first free aligned register.

> do you think it is better to mark operands in the ad file to preferably have the same register as the result?

There are existing DF attributions like USE_DEF which can be used to add such a constraint, but for APX NDD, we do not wish to up-front constrain the source to be the same as the destination, as it defeats the purpose, and the allocator may end up emitting a copy before the NDD instruction to honour this constraint. The idea here is to only bias color selection for non-interfering live ranges to facilitate EEVEX to REX/REX2 demotions.

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

PR Comment: https://git.openjdk.org/jdk/pull/26283#issuecomment-3070203095


More information about the hotspot-compiler-dev mailing list