]> granicus.if.org Git - llvm/commitdiff
[SystemZ] Add check VT.isSimple() in canTreateAsByteVector()
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 7 Mar 2017 09:49:31 +0000 (09:49 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Tue, 7 Mar 2017 09:49:31 +0000 (09:49 +0000)
Since BB-vectorizer can produce vectors of for example 3 elements,
this check is needed.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297136 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SystemZ/SystemZISelLowering.cpp
test/CodeGen/SystemZ/vectorizer-output-3xi32.ll [new file with mode: 0644]

index afc9e60bdf215843428842fd82e8825cf33f7c26..6322098e1c358f4eac17d9938e88f136a52b92d6 100644 (file)
@@ -4737,7 +4737,7 @@ const char *SystemZTargetLowering::getTargetNodeName(unsigned Opcode) const {
 // Return true if VT is a vector whose elements are a whole number of bytes
 // in width.
 static bool canTreatAsByteVector(EVT VT) {
-  return VT.isVector() && VT.getScalarSizeInBits() % 8 == 0;
+  return VT.isVector() && VT.getScalarSizeInBits() % 8 == 0 && VT.isSimple();
 }
 
 // Try to simplify an EXTRACT_VECTOR_ELT from a vector of type VecVT
diff --git a/test/CodeGen/SystemZ/vectorizer-output-3xi32.ll b/test/CodeGen/SystemZ/vectorizer-output-3xi32.ll
new file mode 100644 (file)
index 0000000..3e7ba60
--- /dev/null
@@ -0,0 +1,10 @@
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13
+;
+; This tescase origininates from the BB-vectorizer output.
+
+define void @fun() {
+  %1 = zext <3 x i1> zeroinitializer to <3 x i32>
+  %2 = extractelement <3 x i32> %1, i32 2
+  store i32 %2, i32* undef, align 8
+  unreachable
+}