OSDN Git Service

Test case for r191314.
authorYi Jiang <yjiang@apple.com>
Tue, 24 Sep 2013 19:33:53 +0000 (19:33 +0000)
committerYi Jiang <yjiang@apple.com>
Tue, 24 Sep 2013 19:33:53 +0000 (19:33 +0000)
Some supplemental information for r191314: We would like to make sure SLP Vectorizer will not try to vectorize tiny trees even with a negative threshold so we set the cost to INT_MAX.

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

test/Transforms/SLPVectorizer/X86/tiny-tree.ll [new file with mode: 0644]

diff --git a/test/Transforms/SLPVectorizer/X86/tiny-tree.ll b/test/Transforms/SLPVectorizer/X86/tiny-tree.ll
new file mode 100644 (file)
index 0000000..d816232
--- /dev/null
@@ -0,0 +1,27 @@
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.8.0"
+; RUN: opt < %s -basicaa -slp-vectorizer -slp-threshold=-5 -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7 | FileCheck %s
+
+%t1 = type {%t2, double, double, i8 }
+%t2 = type { double, double, double }
+%t3 = type { double, double, i8 }
+
+; We check that SLP vectorizer will not try to vectorize tiny trees
+; even with a negative threshold.  
+; CHECK: tiny_tree_test
+; CHECK-NOT:  <2 x double>
+; CHECK: ret 
+
+define void @tiny_tree_test(%t3* %this, %t1* %m)  align 2 {
+entry:
+  %m41.i = getelementptr inbounds %t1* %m, i64 0, i32 0, i32 1
+  %0 = load double* %m41.i, align 8
+  %_tx = getelementptr inbounds %t3* %this, i64 0, i32 0
+  store double %0, double* %_tx, align 8
+  %m42.i = getelementptr inbounds %t1* %m, i64 0, i32 0, i32 2
+  %1 = load double* %m42.i, align 8
+  %_ty = getelementptr inbounds %t3* %this, i64 0, i32 1
+  store double %1, double* %_ty, align 8
+  ret void
+}
+