From e64f5e00264ae7b3f3a2a5904cf2ca2deab6ed6e Mon Sep 17 00:00:00 2001 From: Yi Jiang Date: Tue, 24 Sep 2013 19:33:53 +0000 Subject: [PATCH] Test case for r191314. 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 --- .../Transforms/SLPVectorizer/X86/tiny-tree.ll | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/Transforms/SLPVectorizer/X86/tiny-tree.ll diff --git a/test/Transforms/SLPVectorizer/X86/tiny-tree.ll b/test/Transforms/SLPVectorizer/X86/tiny-tree.ll new file mode 100644 index 00000000000..d816232baf7 --- /dev/null +++ b/test/Transforms/SLPVectorizer/X86/tiny-tree.ll @@ -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 +} +