RFR: 8259840: [Vector API] Fix an assert in Assembler::vpmovzxbw if UseAVX=0

Jie Fu jiefu at openjdk.java.net
Fri Jan 15 13:45:10 UTC 2021


Hi all,

This assert was observed when running jdk/incubator/vector/ShortMaxVectorTests.java with -XX:UseAVX=0.

#
#  Internal Error (/home/jvm/jiefu/docker/jdk/src/hotspot/cpu/x86/assembler_x86.cpp:4263), pid=19129, tid=19145
#  Error: assert(vector_len == AVX_128bit? VM_Version::supports_avx() : vector_len == AVX_256bit? VM_Version::supports_avx2() : vector_len == AVX_512bit? VM_Version::supports_avx512bw() : 0) failed
#

Stack: [0x00007f4c095fa000,0x00007f4c096fb000],  sp=0x00007f4c096f5d40,  free space=1007k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x5e0ab6]  Assembler::vpmovzxbw(XMMRegisterImpl*, XMMRegisterImpl*, int)+0x136
V  [libjvm.so+0x41d0dd]  loadShuffleSNode::emit(CodeBuffer&, PhaseRegAlloc*) const+0x3ad
V  [libjvm.so+0x13ea963]  PhaseOutput::scratch_emit_size(Node const*)+0x423
V  [libjvm.so+0x13e1b44]  PhaseOutput::shorten_branches(unsigned int*)+0x2a4
V  [libjvm.so+0x13f25aa]  PhaseOutput::Output()+0xb8a
V  [libjvm.so+0x96a003]  Compile::Code_Gen()+0x443
V  [libjvm.so+0x97303a]  Compile::Compile(ciEnv*, ciMethod*, int, bool, bool, bool, bool, DirectiveSet*)+0x178a

The reason is that loadShuffleS should not use vpmovzxbw when -XX:UseAVX=0.
The fix splits loadShuffleS's AVX code-gen logic into loadShuffleS_avx.

Testing:
  - jdk/incubator/vector on an AVX512 machine with UseAVX=3/2/1/0, no regression

Thanks.
Best regards,
Jie

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

Commit messages:
 - 8259840: [Vector API] Fix an assert in Assembler::vpmovzxbw if UseAVX=0

Changes: https://git.openjdk.java.net/jdk/pull/2100/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2100&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8259840
  Stats: 52 lines in 1 file changed: 26 ins; 16 del; 10 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2100.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2100/head:pull/2100

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


More information about the hotspot-compiler-dev mailing list