summaryrefslogtreecommitdiff
path: root/test/Transforms/SLPVectorizer
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-04-14 05:15:53 +0000
committerNadav Rotem <nrotem@apple.com>2013-04-14 05:15:53 +0000
commitab105ae95fc473c19d9f0b019fc7c7a16d17b1a5 (patch)
tree27247e73ffdef91c52268c935d65afd7c066c1c0 /test/Transforms/SLPVectorizer
parent618eda7a60bafff7741a988e27b98bf81d27cb89 (diff)
downloadllvm-ab105ae95fc473c19d9f0b019fc7c7a16d17b1a5.tar.gz
llvm-ab105ae95fc473c19d9f0b019fc7c7a16d17b1a5.tar.bz2
llvm-ab105ae95fc473c19d9f0b019fc7c7a16d17b1a5.tar.xz
SLPVectorizer: Add support for trees that don't start at binary operators, and add the cost of extracting values from the roots of the tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SLPVectorizer')
-rw-r--r--test/Transforms/SLPVectorizer/X86/reduction2.ll37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/Transforms/SLPVectorizer/X86/reduction2.ll b/test/Transforms/SLPVectorizer/X86/reduction2.ll
new file mode 100644
index 0000000000..9b5d5f701d
--- /dev/null
+++ b/test/Transforms/SLPVectorizer/X86/reduction2.ll
@@ -0,0 +1,37 @@
+; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=x86_64-apple-macosx10.8.0 -mcpu=corei7-avx | FileCheck %s
+
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128"
+target triple = "i386-apple-macosx10.8.0"
+
+;CHECK: @foo
+;CHECK: load <2 x double>
+;CHECK: ret
+define double @foo(double* nocapture %D) #0 {
+ br label %1
+
+; <label>:1 ; preds = %1, %0
+ %i.02 = phi i32 [ 0, %0 ], [ %10, %1 ]
+ %sum.01 = phi double [ 0.000000e+00, %0 ], [ %9, %1 ]
+ %2 = shl nsw i32 %i.02, 1
+ %3 = getelementptr inbounds double* %D, i32 %2
+ %4 = load double* %3, align 4, !tbaa !0
+ %A4 = fmul double %4, %4
+ %5 = or i32 %2, 1
+ %6 = getelementptr inbounds double* %D, i32 %5
+ %7 = load double* %6, align 4, !tbaa !0
+ %A7 = fmul double %7, %7
+ %8 = fadd double %A4, %A7
+ %9 = fadd double %sum.01, %8
+ %10 = add nsw i32 %i.02, 1
+ %exitcond = icmp eq i32 %10, 100
+ br i1 %exitcond, label %11, label %1
+
+; <label>:11 ; preds = %1
+ ret double %9
+}
+
+attributes #0 = { nounwind readonly ssp "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
+
+!0 = metadata !{metadata !"double", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA"}