Skip to content

Commit 874d68a

Browse files
committed
8343747: C2: TestReplicateAtConv.java crashes with -XX:MaxVectorSize=8
Reviewed-by: epeter, kvn
1 parent d9a2213 commit 874d68a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/hotspot/share/opto/vectornode.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,9 @@ bool VectorCastNode::implemented(int opc, uint vlen, BasicType src_type, BasicTy
14661466
if (is_java_primitive(dst_type) &&
14671467
is_java_primitive(src_type) &&
14681468
(vlen > 1) && is_power_of_2(vlen) &&
1469+
// In rare case, the input to the VectorCast could be a Replicate node. We need to make sure creating is supported:
1470+
// check the src_type:
1471+
VectorNode::vector_size_supported_auto_vectorization(src_type, vlen) &&
14691472
VectorNode::vector_size_supported_auto_vectorization(dst_type, vlen)) {
14701473
int vopc = VectorCastNode::opcode(opc, src_type);
14711474
return vopc > 0 && Matcher::match_rule_supported_auto_vectorization(vopc, vlen, dst_type);

test/hotspot/jtreg/compiler/vectorization/TestReplicateAtConv.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323

2424
/**
2525
* @test
26-
* @bug 8341834
27-
* @summary C2 compilation fails with "bad AD file" due to Replicate
26+
* @bug 8341834 8343747
27+
* @summary Replicate node at a VectorCast (ConvL2I) causes superword to fail
2828
* @run main/othervm -XX:CompileCommand=compileonly,TestReplicateAtConv::test -Xcomp TestReplicateAtConv
29+
* @run main/othervm -XX:CompileCommand=compileonly,TestReplicateAtConv::test -Xcomp -XX:MaxVectorSize=8 TestReplicateAtConv
2930
*/
3031

3132
public class TestReplicateAtConv {

0 commit comments

Comments
 (0)