[llvm] r297136 - [SystemZ] Add check VT.isSimple() in canTreateAsByteVector()

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 01:49:32 PST 2017


Author: jonpa
Date: Tue Mar  7 03:49:31 2017
New Revision: 297136

URL: http://llvm.org/viewvc/llvm-project?rev=297136&view=rev
Log:
[SystemZ] Add check VT.isSimple() in canTreateAsByteVector()

Since BB-vectorizer can produce vectors of for example 3 elements,
this check is needed.

Review: Ulrich Weigand

Added:
    llvm/trunk/test/CodeGen/SystemZ/vectorizer-output-3xi32.ll
Modified:
    llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp

Modified: llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp?rev=297136&r1=297135&r2=297136&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp Tue Mar  7 03:49:31 2017
@@ -4737,7 +4737,7 @@ const char *SystemZTargetLowering::getTa
 // 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

Added: llvm/trunk/test/CodeGen/SystemZ/vectorizer-output-3xi32.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SystemZ/vectorizer-output-3xi32.ll?rev=297136&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/SystemZ/vectorizer-output-3xi32.ll (added)
+++ llvm/trunk/test/CodeGen/SystemZ/vectorizer-output-3xi32.ll Tue Mar  7 03:49:31 2017
@@ -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
+}




More information about the llvm-commits mailing list