summaryrefslogtreecommitdiff
path: root/test/CodeGen/SystemZ
diff options
context:
space:
mode:
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>2017-04-05 13:45:37 +0000
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>2017-04-05 13:45:37 +0000
commit4a035b600a70f1e1b678186b6fcad5c73603b6a5 (patch)
treec96aa0e870b65f6da795346ddea52f67f0af8d12 /test/CodeGen/SystemZ
parent0a06935a2e6f997ac2cb682059838b88c4a2abe4 (diff)
[DAGCombiner] Don't make a BUILD_VECTOR with operands of illegal type.
When DAGCombiner visits a SIGN_EXTEND_INREG of a BUILD_VECTOR with constant operands, a new BUILD_VECTOR node will be created transformed constants. Llvm-stress found a case where the new BUILD_VECTOR had constant operands of an illegal type, because the (legal) element type is in fact not a legal scalar type. This patch changes this so that the new BUILD_VECTOR has the same operand type as the old one. Review: Eli Friedman, Nirav Dave https://bugs.llvm.org//show_bug.cgi?id=32422 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299540 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ')
-rw-r--r--test/CodeGen/SystemZ/DAGCombiner_illegal_BUILD_VECTOR.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/DAGCombiner_illegal_BUILD_VECTOR.ll b/test/CodeGen/SystemZ/DAGCombiner_illegal_BUILD_VECTOR.ll
new file mode 100644
index 00000000000..3e5757c902c
--- /dev/null
+++ b/test/CodeGen/SystemZ/DAGCombiner_illegal_BUILD_VECTOR.ll
@@ -0,0 +1,26 @@
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
+;
+; Check that DAGCombiner does not crash after producing an illegal
+; BUILD_VECTOR node.
+
+
+define void @pr32422() {
+; CHECK: cdbr %f0, %f0
+; CHECK: jo .LBB0_1
+
+BB:
+ %I = insertelement <8 x i8> zeroinitializer, i8 -95, i32 3
+ %I8 = insertelement <8 x i8> zeroinitializer, i8 -119, i32 2
+ %FC = uitofp <8 x i8> %I8 to <8 x float>
+ %Cmp18 = fcmp uno <8 x float> zeroinitializer, %FC
+ %I22 = insertelement <8 x i1> %Cmp18, i1 true, i32 5
+ br label %CF
+
+CF: ; preds = %CF, %BB
+ %Cmp40 = fcmp uno double 0xC663C682E9619F00, undef
+ br i1 %Cmp40, label %CF, label %CF353
+
+CF353: ; preds = %CF
+ %E195 = extractelement <8 x i1> %I22, i32 4
+ ret void
+}