RFR: 8258134: assert(size == calc_size) failed: incorrect size calculation on x86_32 with AVX512 machines

Jie Fu jiefu at openjdk.java.net
Tue Dec 15 01:27:55 UTC 2020


On Mon, 14 Dec 2020 16:07:42 GMT, Nils Eliasson <neliasso at openjdk.org> wrote:

>> Hi all,
>> 
>> Two vector api tests crashed on x86_32 with AVX512 machines due to this assert [1].
>> The reason is that 'calc_size' is incorrect.
>> 
>> But there is no need to calculate 'calc_size' manually at all since the result [2] is actually never used by the VM.
>> Also, it is really hard to maintain the calculation logic for various hardwares and configurations.
>> And it may be easily broken again in the future with more and more complicated instructions & configurations.
>> 
>> So it would be better to remove the calculation and the assert, which is safe and already done for x86_64 [3].
>> The fix just follows what is done for x86_64.
>> 
>> Thanks.
>> Best regards,
>> Jie
>> 
>> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/x86_32.ad#L1016
>> [2] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/x86_32.ad#L1059
>> [3] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/x86_64.ad#L1042
>
> src/hotspot/cpu/x86/x86_32.ad line 1062:
> 
>> 1060:       int src_offset = ra_->reg2offset(src_first);
>> 1061:       int dst_offset = ra_->reg2offset(dst_first);
>> 1062:       vec_stack_to_stack_helper(cbuf, src_offset, dst_offset, ireg, st);
> 
> None of these functions (vec_stack_to_stack_helper, vec_mov_helper, vec_spill_helper, vec_spill_helper) returns a value that is used on either x86 or x64 now. 
> 
> Please make them all return void.

Thanks @neliasso for your review.
Will do it later.

And I'll close this pr and create a new one into jdk16 since this issue had been targeted to jdk16.

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

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


More information about the hotspot-compiler-dev mailing list