RFR: 8294261: AArch64: Use pReg instead of pRegGov when possible

Xiaohong Gong xgong at openjdk.org
Sun Oct 9 06:04:05 UTC 2022


On Wed, 28 Sep 2022 05:52:40 GMT, Ningsheng Jian <njian at openjdk.org> wrote:

> Currently we allocate SVE predicate register p0-p6 for pRegGov operand, which are used as governing predicates for load/store and arithmetic, and also define pReg operand for all allocatable predicate registers. Since some SVE instructions are fine to use/define p8-p15, e.g. predicate operations, this patch makes the matcher work for mixed use of pRegGov and pReg, and tries to match pReg when possible. If a predicate reg is defined as pReg but used as pRegGov, register allocator will handle that properly.
> 
> With p8-p15 being used as non-temp register, we need to save them as well when saving all registers. The code of setting predicate reg slot in OopMap in RegisterSaver::save_live_registers() is also removed, because on safepoint, vector masks have been transformed to vector [1].
> 
> Tested on different SVE systems. Also tested with making RA to allocate p8-p15 first for vReg operand, so that a p8-p15 reg has more chance to be allocated, and if an SVE instruction, emitted by ad rule, does not accept p8-p5, assembler will crash.
> 
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/vector.cpp#L265

LGTM!

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

Marked as reviewed by xgong (Committer).

PR: https://git.openjdk.org/jdk/pull/10461


More information about the hotspot-dev mailing list