RFR: ZGC: C2: Add MaxVectorSize support in C2 load barrier ad rules
Per Liden
per.liden at oracle.com
Fri Mar 9 08:49:25 UTC 2018
I've been running tests with this patch and have not found any issues.
Please go ahead and push Nils.
/Per
On 03/09/2018 09:41 AM, Rickard Bäckman wrote:
> Not a reviewer in zgc, but looks good to me.
>
> /R
>
> On 03/08, Nils Eliasson wrote:
>> Hi,
>>
>> This patch fixes failures when MaxVectorSize and the size of supported
>> vectors doesn't correlate. It can be easily be reproduced with: "java
>> -XX:+UseZGC -XX:MaxVectorSize=16" on any CPU with AVX2 support.
>>
>> "assert((uint)_ideal_reg < (uint)_last_machine_leaf &&
>> Type::mreg2type[_ideal_reg]) failed: in bounds)"
>>
>> This bug is a big problem on many AMD systems (family < 0x17h) where
>> MaxVectorSize is set default 16 even when larger vectors are supported.
>> MaxVectorSize will limit the initialized vector types (TypeVect::VECTZ etc.)
>> to those actually available. In the loadbarrier matcher we fail when we try
>> to kill YMM but no YMM-type is initialized.
>>
>> In this patch we instead have rules specialized on the number of vector regs
>> that need to be killed, and only kill the lowest sub reg of the vector. This
>> has the effect that the entire vector use is killed, but that only types
>> that are guaranteed to be supported are available.
>>
>> This patch was forgotten in a dev branch when we transfered to openJDK. It
>> has been tested on the few different CPU familys available to me.
>>
>> http://cr.openjdk.java.net/~neliasso/zgc/maxvectorsize
>>
>> Regards,
>>
>> Nils
>>
More information about the zgc-dev
mailing list