RFR: 8256058: Improve vector register handling in RegisterMap::pd_location() on x86

Vladimir Ivanov vlivanov at openjdk.java.net
Fri Nov 20 17:17:07 UTC 2020


On Tue, 10 Nov 2020 00:14:37 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> `RegisterMap` handles registers on a per-slot basis: every register is split into slot-sized (32-bit) parts that are tracked independently. On x86 vector registers are up to 512-bit in size and occupy up to 16 slots. In order to save on constructing RegisterMaps, `RegisterMap`s are sparsely populated: location of the first slot is recorded and the rest is derived from it and `RegisterMap::pd_location()` is used to compute the address of a particular slot if it is missing in the map.
>> 
>> As I mentioned in #1131, frame layout for vector registers is quite complicated: ZMM0-15 are split in 3 parts (2 x 128-bit + 1 x 256-bit) when saved while ZMM16-31 are stored in full.
>> 
>> Proposed patch reifies those details in `RegisterMap::pd_location()` logic and it becomes possible to initialize just 3 slot locations for ZMM0-15 to be able to recover every slot location inside the register while for ZMM16-31 initializing a single (base) slot is enough. 
>> 
>> Testing (along with some other relevant patches):
>> - [x] jdk/incubator/vector w/ -XX:+DeoptimizeALot and -XX:UseAVX=3 on AVX512-capable hardware
>> - [x] hs-precheckin-comp, hs-tier1, hs-tier2
>
> Good

Thanks for the review, Vladimir.

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

PR: https://git.openjdk.java.net/jdk/pull/1132


More information about the hotspot-compiler-dev mailing list