JDK-8183319 : Post loop vectorization fails with "Error mixing types: int and vectorz"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2017-06-30
  • Updated: 2017-07-05
  • Resolved: 2017-07-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10
10Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
CTW w/ jdk9+175 on SKL host (Intel(R) Xeon(R) Platinum 8168 CPU @ 2.70GHz) hits ShouldNotReachHere assertion compiling com.sun.imageio.plugins.jpeg.ImageTypeProducer::produce

Current thread (0x00007f37144a7800):  JavaThread "C2 CompilerThread5" daemon [_thread_in_native, id=430579, stack(0x00007f347e16b000,0x00007f347e26c000)]


Current CompileTask:
C2:3207325 407889    b  4       com.sun.imageio.plugins.jpeg.ImageTypeProducer::produce (145 bytes)

Stack: [0x00007f347e16b000,0x00007f347e26c000],  sp=0x00007f347e266280,  free space=1004k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x16d5af2]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x162
V  [libjvm.so+0x16d687f]  VMError::report_and_die(Thread*, char const*, int, char const*, char const*, __va_list_tag*)+0x2f
V  [libjvm.so+0xaa4e6d]  report_vm_error(char const*, int, char const*, char const*, ...)+0xdd
V  [libjvm.so+0x1650334]  Type::typerr(Type const*) const+0x74
V  [libjvm.so+0x1650e9b]  TypeInt::xmeet(Type const*) const+0xeb
V  [libjvm.so+0x1655a64]  Type::meet_helper(Type const*, bool) const+0x44
V  [libjvm.so+0x87c930]  PhiNode::Value(PhaseGVN*) const+0x180
V  [libjvm.so+0x1428dad]  PhaseIterGVN::transform_old(Node*)+0x29d
V  [libjvm.so+0x14251da]  PhaseIterGVN::optimize()+0x5a
V  [libjvm.so+0x1187575]  PhaseIdealLoop::build_and_optimize(bool, bool)+0xec5
V  [libjvm.so+0xa13f99]  Compile::Optimize()+0xe79
V  [libjvm.so+0xa1554e]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool, DirectiveSet*)+0x124e
V  [libjvm.so+0x845562]  C2Compiler::compile_method(ciEnv*, ciMethod*, int, DirectiveSet*)+0x2e2
V  [libjvm.so+0xa20756]  CompileBroker::invoke_compiler_on_method(CompileTask*)+0x3d6
V  [libjvm.so+0xa21421]  CompileBroker::compiler_thread_loop()+0x2e1
V  [libjvm.so+0x163a69e]  JavaThread::thread_main_inner()+0x22e
V  [libjvm.so+0x163a92e]  JavaThread::run()+0x1ce
V  [libjvm.so+0x138b402]  thread_native_entry(Thread*)+0x112
C  [libpthread.so.0+0x7dc5]  start_thread+0xc5
Comments
In answer to a comment above, using UseAVX=2 is in effect the same thing as turning off post loop mulitversioning as its it only utilized on some EVEX enabled machines, like SKX, but not by Knights family machines, the comment needs to abridged so that the issues remain separate, the issue is not a general UseAVX=3 issue, only a post loop multiversioning issue.
05-07-2017

This is another problem with post loop vectorization (similar to JDK-8183103). It should be fixed with JDK-8183390 in JDK 10. Closing this as duplicate.
03-07-2017

Here's the relevant output of -XX:+TraceNewVectors -XX:+TraceSuperWord -XX:+TraceLoopOpts: Block 0 8228 CountedLoop === 8228 8242 8231 [[ 8221 8225 8228 8229 8230 ]] inner stride: 1 post of N6030 !orig=[6030],[5991],[1082] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 1 8225 Phi === 8228 12703 8221 [[ 8221 ]] #memory Memory: @int[int:>=0]:exact+any *, idx=23; !orig=1081 !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 2 8229 Phi === 8228 8243 8219 [[ 8219 8227 ]] #int:2..max-1:www #tripcount !orig=[528] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 3 8219 AddI === _ 8229 306 [[ 8218 8229 8234 ]] !orig=6026,[1083] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 4 8218 CmpI === _ 8219 521 [[ 8217 ]] !orig=6027,[4058] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 5 8217 Bool === _ 8218 [[ 8230 ]] [lt] !orig=6028,[3464] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 6 8227 CastII === 7325 8229 [[ 8226 ]] #int:2..max-3:www range check dependency !orig=[5028] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 7 8226 ConvI2L === _ 8227 [[ 8224 ]] #long:2..maxint-3:www !orig=[4581] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 8 8224 LShiftL === _ 8226 505 [[ 8223 ]] !orig=[4056] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 9 8223 AddP === _ 522 522 8224 [[ 8222 ]] !orig=[3462] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 10 8222 AddP === _ 522 8223 1287 [[ 8221 ]] !orig=[2743] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 11 8221 StoreI === 8228 8225 8222 523 [[ 8220 8225 8236 ]] @int[int:>=0]:exact+any *, idx=23; Memory: @int[int:0..max-2]:NotNull:exact+any *, idx=23; !orig=[1886],[8267] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 12 8220 LoadI === _ 8221 670 [[ 8235 ]] @int[int:>=0]:exact+any *, idx=23; #int !orig=7103,[1104] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 SuperWord::output Loop: N8228/N8231 counted [int,int),+1 (4 iters) post has_sfpt PhaseIdealLoop::create_reserve_version_of_loop: iff = 13574, 13574 If === 8242 306 [[ 13575 13576 ]] P=0.999999, C=-1.000000 iffast = 13575, 13575 IfTrue === 13574 [[]] #1 ifslow = 13576, 13576 IfFalse === 13574 [[]] #0 before replace_input_of: head = 8228, 8228 CountedLoop === 8228 8242 8231 [[ 8221 8225 8228 8229 8230 ]] inner stride: 1 post of N6030 !orig=[6030],[5991],[1082] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 before replace_input_of: slow_head = 13589, 13589 CountedLoop === 13589 8242 13591 [[ 13581 13587 13588 13589 13590 ]] inner stride: 1 post of N6030 !orig=8228,[6030],[5991],[1082] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 after replace_input_of: head = 8228, 8228 CountedLoop === 8228 13575 8231 [[ 8221 8225 8228 8229 8230 ]] inner stride: 1 post of N6030 !orig=[6030],[5991],[1082] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 after replace_input_of: slow_head = 13589, 13589 CountedLoop === 13589 13576 13591 [[ 13581 13587 13588 13589 13590 ]] inner stride: 1 post of N6030 !orig=8228,[6030],[5991],[1082] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 new Vector node: 13597 ReplicateI === _ 523 [[]] #vectorz[16]:{int} new Vector node: 13598 StoreVector === 8228 8225 8222 13597 [[ 13596 8225 8220 ]] @int[int:0..max-2]:NotNull:exact+any *, idx=23; Memory: @int[int:0..max-2]:NotNull:exact+any *, idx=23; !orig=[8221],[1886],[8267] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 new Vector node: 13599 LoadVector === _ 8225 670 [[ 13595 ]] @int[int:6]<ciTypeArray length=6 type=<ciTypeArrayKlass name=[I ident=1087 address=0x00007fbda8017d20> ident=1146 SCAVENGABLE address=0x00007fbda80e7780>[0] *, idx=23; #vectorz[16]:{int} !orig=[8220],7103,[1104] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 13599 LoadVector === _ 8225 670 [[ 13595 ]] @int[int:6]<ciTypeArray length=6 type=<ciTypeArrayKlass name=[I ident=1087 address=0x00007fcddc00fcf0> ident=1146 SCAVENGABLE address=0x00007fcdc0097870>[0] *, idx=23; #vectorz[16]:{int} !orig=[8220],7103,[1104] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 13580 LoadI === _ 13581 670 [[ 13595 ]] @int[int:>=0]:exact+any *, idx=23; #int !orig=[8220],7103,[1104] !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:15 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 13593 Region === 13593 13592 8232 [[ 13593 8233 13594 13595 13596 ]] 13595 Phi === 13593 13580 13599 [[ 8235 ]] #int 13595 Phi === 13593 13580 13599 [[ 8235 ]] #int 8235 Phi === 8233 13595 12702 [[ 8205 ]] #int !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:239 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 8205 Phi === 8202 8189 8235 [[ 8177 ]] #int !jvms: ImageTypeSpecifier$Interleaved::<init> @ bci:236 ImageTypeSpecifier::createInterleaved @ bci:10 ImageTypeProducer::produce @ bci:114 We vectorize the 8221 StoreI and 8220 LoadI in the post loop N8228/N8231 and then crash while processing 13595 Phi due to "Error mixing types: int and vectorz[16]:{int}". The 8220 LoadI is connected to a PhiNode and therefore shouldn't be vectorized.
03-07-2017

for jdk9+b175, the next command line will execute CTW only for com.sun.imageio.plugins.jpeg.ImageTypeProducer class: $ java -XX:+CompileTheWorld -XX:CompileTheWorldStartAt=35758 -XX:CompileTheWorldStopAt=35758
30-06-2017

[~thartmann], could you please take a look?
30-06-2017

replaying it w/ either -XX:-PostLoopMultiversioning or -XX:UseAVX=2 does not lead to the assert on SKL. might be realted to JDK-8183103
30-06-2017

replaying the same compilation on Intel(R) Xeon(R) CPU E5-2690 did not lead to the assert.
30-06-2017

attached compilation replay file -- replay_pid430424.log
30-06-2017