Skip to content
Permalink
Browse files
8259430: C2: assert(in_vt->length() == out_vt->length()) failed: mism…
…atch on number of elements

Reviewed-by: kvn, thartmann
  • Loading branch information
Vladimir Ivanov committed Feb 11, 2021
1 parent 1662373 commit 3ede231dec1c5aca94a39f995b47421301b1db0a
Showing with 21 additions and 17 deletions.
  1. +21 −16 src/hotspot/share/opto/vectornode.cpp
  2. +0 −1 test/jdk/ProblemList-Xcomp.txt
@@ -1225,25 +1225,30 @@ Node* VectorUnboxNode::Ideal(PhaseGVN* phase, bool can_reshape) {
ciKlass* vbox_klass = vbox->box_type()->klass();
const TypeVect* in_vt = vbox->vec_type();
const TypeVect* out_vt = type()->is_vect();
assert(in_vt->length() == out_vt->length(), "mismatch on number of elements");
Node* value = vbox->in(VectorBoxNode::Value);

bool is_vector_mask = vbox_klass->is_subclass_of(ciEnv::current()->vector_VectorMask_klass());
bool is_vector_shuffle = vbox_klass->is_subclass_of(ciEnv::current()->vector_VectorShuffle_klass());
if (is_vector_mask) {
// VectorUnbox (VectorBox vmask) ==> VectorLoadMask (VectorStoreMask vmask)
value = phase->transform(VectorStoreMaskNode::make(*phase, value, in_vt->element_basic_type(), in_vt->length()));
return new VectorLoadMaskNode(value, out_vt);
} else if (is_vector_shuffle) {
if (is_shuffle_to_vector()) {
// VectorUnbox (VectorBox vshuffle) ==> VectorCastB2X vshuffle
return new VectorCastB2XNode(value, out_vt);

if (in_vt->length() == out_vt->length()) {
Node* value = vbox->in(VectorBoxNode::Value);

bool is_vector_mask = vbox_klass->is_subclass_of(ciEnv::current()->vector_VectorMask_klass());
bool is_vector_shuffle = vbox_klass->is_subclass_of(ciEnv::current()->vector_VectorShuffle_klass());
if (is_vector_mask) {
// VectorUnbox (VectorBox vmask) ==> VectorLoadMask (VectorStoreMask vmask)
value = phase->transform(VectorStoreMaskNode::make(*phase, value, in_vt->element_basic_type(), in_vt->length()));
return new VectorLoadMaskNode(value, out_vt);
} else if (is_vector_shuffle) {
if (is_shuffle_to_vector()) {
// VectorUnbox (VectorBox vshuffle) ==> VectorCastB2X vshuffle
return new VectorCastB2XNode(value, out_vt);
} else {
// VectorUnbox (VectorBox vshuffle) ==> VectorLoadShuffle vshuffle
return new VectorLoadShuffleNode(value, out_vt);
}
} else {
// VectorUnbox (VectorBox vshuffle) ==> VectorLoadShuffle vshuffle
return new VectorLoadShuffleNode(value, out_vt);
// Vector type mismatch is only supported for masks and shuffles, but sometimes it happens in pathological cases.
}
} else {
assert(false, "type mismatch on vector: %s", vbox_klass->name()->as_utf8());
// Vector length mismatch.
// Sometimes happen in pathological cases (e.g., when unboxing happens in effectively dead code).
}
}
}
@@ -29,4 +29,3 @@

java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all
java/util/stream/test/org/openjdk/tests/java/util/stream/SpliteratorTest.java 8256368 generic-all
jdk/incubator/vector/VectorHash.java 8259430 generic-all

0 comments on commit 3ede231

Please sign in to comment.