aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/LoopVectorize/ARM
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-01-09 01:15:42 +0000
committerNadav Rotem <nrotem@apple.com>2013-01-09 01:15:42 +0000
commit83be7b0dd3ae9a3cb22d36ae4c1775972553b94b (patch)
tree5ca1c69275faaa284ac3abe27e3f56c31b0e0ae1 /test/Transforms/LoopVectorize/ARM
parentd700a2f9c54e3312d28c132663bf60f81662b7f7 (diff)
downloadexternal_llvm-83be7b0dd3ae9a3cb22d36ae4c1775972553b94b.zip
external_llvm-83be7b0dd3ae9a3cb22d36ae4c1775972553b94b.tar.gz
external_llvm-83be7b0dd3ae9a3cb22d36ae4c1775972553b94b.tar.bz2
Cost Model: Move the 'max unroll factor' variable to the TTI and add initial Cost Model support on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopVectorize/ARM')
-rw-r--r--test/Transforms/LoopVectorize/ARM/lit.local.cfg6
-rw-r--r--test/Transforms/LoopVectorize/ARM/sanity.ll25
2 files changed, 31 insertions, 0 deletions
diff --git a/test/Transforms/LoopVectorize/ARM/lit.local.cfg b/test/Transforms/LoopVectorize/ARM/lit.local.cfg
new file mode 100644
index 0000000..cb77b09
--- /dev/null
+++ b/test/Transforms/LoopVectorize/ARM/lit.local.cfg
@@ -0,0 +1,6 @@
+config.suffixes = ['.ll', '.c', '.cpp']
+
+targets = set(config.root.targets_to_build.split())
+if not 'ARM' in targets:
+ config.unsupported = True
+
diff --git a/test/Transforms/LoopVectorize/ARM/sanity.ll b/test/Transforms/LoopVectorize/ARM/sanity.ll
new file mode 100644
index 0000000..11c28a8
--- /dev/null
+++ b/test/Transforms/LoopVectorize/ARM/sanity.ll
@@ -0,0 +1,25 @@
+; RUN: opt < %s -loop-vectorize -mtriple=thumbv7-apple-ios3.0.0 -S
+
+target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
+target triple = "thumbv7-apple-ios3.0.0"
+
+; Make sure that we are not crashing on ARM.
+
+define i32 @foo(i32* nocapture %A, i32 %n) nounwind readonly ssp {
+ %1 = icmp sgt i32 %n, 0
+ br i1 %1, label %.lr.ph, label %._crit_edge
+
+.lr.ph: ; preds = %0, %.lr.ph
+ %i.02 = phi i32 [ %5, %.lr.ph ], [ 0, %0 ]
+ %sum.01 = phi i32 [ %4, %.lr.ph ], [ 0, %0 ]
+ %2 = getelementptr inbounds i32* %A, i32 %i.02
+ %3 = load i32* %2, align 4
+ %4 = add nsw i32 %3, %sum.01
+ %5 = add nsw i32 %i.02, 1
+ %exitcond = icmp eq i32 %5, %n
+ br i1 %exitcond, label %._crit_edge, label %.lr.ph
+
+._crit_edge: ; preds = %.lr.ph, %0
+ %sum.0.lcssa = phi i32 [ 0, %0 ], [ %4, %.lr.ph ]
+ ret i32 %sum.0.lcssa
+}