8328181: C2: assert(MaxVectorSize >= 32) failed: vector length should be >= 32

Reviewed-by: kvn, vlivanov
This commit is contained in:
Jatin Bhateja 2024-04-09 01:37:38 +00:00
parent a887fd2144
commit fbc1e6661e
5 changed files with 16 additions and 17 deletions

View File

@ -5779,7 +5779,7 @@ void MacroAssembler::xmm_clear_mem(Register base, Register cnt, Register rtmp, X
// Clearing constant sized memory using YMM/ZMM registers.
void MacroAssembler::clear_mem(Register base, int cnt, Register rtmp, XMMRegister xtmp, KRegister mask) {
assert(UseAVX > 2 && VM_Version::supports_avx512vlbw(), "");
assert(UseAVX > 2 && VM_Version::supports_avx512vl(), "");
bool use64byteVector = (MaxVectorSize > 32) && (VM_Version::avx3_threshold() == 0);
int vector64_count = (cnt & (~0x7)) >> 3;

View File

@ -1750,7 +1750,6 @@ bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType bt) {
return false;
}
break;
case Op_ClearArray:
case Op_VectorMaskGen:
case Op_VectorCmpMasked:
if (!is_LP64 || !VM_Version::supports_avx512bw()) {

View File

@ -11470,8 +11470,8 @@ instruct expandBitsL_reg(eADXRegL dst, eBCXRegL src, eBDPRegL mask, eSIRegI rtmp
%}
// =======================================================================
// fast clearing of an array
// Small ClearArray non-AVX512.
// Fast clearing of an array
// Small non-constant length ClearArray for non-AVX512 targets.
instruct rep_stos(eCXRegI cnt, eDIRegP base, regD tmp, eAXRegI zero, Universe dummy, eFlagsReg cr) %{
predicate(!((ClearArrayNode*)n)->is_large() && (UseAVX <= 2));
match(Set dummy (ClearArray cnt base));
@ -11531,7 +11531,7 @@ instruct rep_stos(eCXRegI cnt, eDIRegP base, regD tmp, eAXRegI zero, Universe du
ins_pipe( pipe_slow );
%}
// Small ClearArray AVX512 non-constant length.
// Small non-constant length ClearArray for AVX512 targets.
instruct rep_stos_evex(eCXRegI cnt, eDIRegP base, legRegD tmp, kReg ktmp, eAXRegI zero, Universe dummy, eFlagsReg cr) %{
predicate(!((ClearArrayNode*)n)->is_large() && (UseAVX > 2));
match(Set dummy (ClearArray cnt base));
@ -11592,7 +11592,7 @@ instruct rep_stos_evex(eCXRegI cnt, eDIRegP base, legRegD tmp, kReg ktmp, eAXReg
ins_pipe( pipe_slow );
%}
// Large ClearArray non-AVX512.
// Large non-constant length ClearArray for non-AVX512 targets.
instruct rep_stos_large(eCXRegI cnt, eDIRegP base, regD tmp, eAXRegI zero, Universe dummy, eFlagsReg cr) %{
predicate((UseAVX <= 2) && ((ClearArrayNode*)n)->is_large());
match(Set dummy (ClearArray cnt base));
@ -11642,7 +11642,7 @@ instruct rep_stos_large(eCXRegI cnt, eDIRegP base, regD tmp, eAXRegI zero, Unive
ins_pipe( pipe_slow );
%}
// Large ClearArray AVX512.
// Large non-constant length ClearArray for AVX512 targets.
instruct rep_stos_large_evex(eCXRegI cnt, eDIRegP base, legRegD tmp, kReg ktmp, eAXRegI zero, Universe dummy, eFlagsReg cr) %{
predicate((UseAVX > 2) && ((ClearArrayNode*)n)->is_large());
match(Set dummy (ClearArray cnt base));
@ -11692,11 +11692,10 @@ instruct rep_stos_large_evex(eCXRegI cnt, eDIRegP base, legRegD tmp, kReg ktmp,
ins_pipe( pipe_slow );
%}
// Small ClearArray AVX512 constant length.
// Small constant length ClearArray for AVX512 targets.
instruct rep_stos_im(immI cnt, kReg ktmp, eRegP base, regD tmp, rRegI zero, Universe dummy, eFlagsReg cr)
%{
predicate(!((ClearArrayNode*)n)->is_large() &&
((UseAVX > 2) && VM_Version::supports_avx512vlbw()));
predicate(!((ClearArrayNode*)n)->is_large() && (MaxVectorSize >= 32) && VM_Version::supports_avx512vl());
match(Set dummy (ClearArray cnt base));
ins_cost(100);
effect(TEMP tmp, TEMP zero, TEMP ktmp, KILL cr);

View File

@ -10410,7 +10410,7 @@ instruct MoveL2D_reg_reg(regD dst, rRegL src) %{
%}
// Fast clearing of an array
// Small ClearArray non-AVX512.
// Small non-constant lenght ClearArray for non-AVX512 targets.
instruct rep_stos(rcx_RegL cnt, rdi_RegP base, regD tmp, rax_RegI zero,
Universe dummy, rFlagsReg cr)
%{
@ -10470,7 +10470,7 @@ instruct rep_stos(rcx_RegL cnt, rdi_RegP base, regD tmp, rax_RegI zero,
ins_pipe(pipe_slow);
%}
// Small ClearArray AVX512 non-constant length.
// Small non-constant length ClearArray for AVX512 targets.
instruct rep_stos_evex(rcx_RegL cnt, rdi_RegP base, legRegD tmp, kReg ktmp, rax_RegI zero,
Universe dummy, rFlagsReg cr)
%{
@ -10531,7 +10531,7 @@ instruct rep_stos_evex(rcx_RegL cnt, rdi_RegP base, legRegD tmp, kReg ktmp, rax_
ins_pipe(pipe_slow);
%}
// Large ClearArray non-AVX512.
// Large non-constant length ClearArray for non-AVX512 targets.
instruct rep_stos_large(rcx_RegL cnt, rdi_RegP base, regD tmp, rax_RegI zero,
Universe dummy, rFlagsReg cr)
%{
@ -10582,7 +10582,7 @@ instruct rep_stos_large(rcx_RegL cnt, rdi_RegP base, regD tmp, rax_RegI zero,
ins_pipe(pipe_slow);
%}
// Large ClearArray AVX512.
// Large non-constant length ClearArray for AVX512 targets.
instruct rep_stos_large_evex(rcx_RegL cnt, rdi_RegP base, legRegD tmp, kReg ktmp, rax_RegI zero,
Universe dummy, rFlagsReg cr)
%{
@ -10633,11 +10633,10 @@ instruct rep_stos_large_evex(rcx_RegL cnt, rdi_RegP base, legRegD tmp, kReg ktmp
ins_pipe(pipe_slow);
%}
// Small ClearArray AVX512 constant length.
// Small constant length ClearArray for AVX512 targets.
instruct rep_stos_im(immL cnt, rRegP base, regD tmp, rRegI zero, kReg ktmp, Universe dummy, rFlagsReg cr)
%{
predicate(!((ClearArrayNode*)n)->is_large() &&
((UseAVX > 2) && VM_Version::supports_avx512vlbw()));
predicate(!((ClearArrayNode*)n)->is_large() && (MaxVectorSize >= 32) && VM_Version::supports_avx512vl());
match(Set dummy (ClearArray cnt base));
ins_cost(100);
effect(TEMP tmp, TEMP zero, TEMP ktmp, KILL cr);

View File

@ -31,6 +31,8 @@
* -XX:InitArrayShortSize=32768 -XX:-IdealizeClearArrayNode compiler.c2.ClearArray
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Xbatch
* -XX:InitArrayShortSize=32768 -XX:-IdealizeClearArrayNode -XX:UseAVX=3 compiler.c2.ClearArray
* @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -Xbatch
* -XX:InitArrayShortSize=32768 -XX:MaxVectorSize=8 -XX:-IdealizeClearArrayNode -XX:UseAVX=3 compiler.c2.ClearArray
*/
package compiler.c2;