diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-10-18 05:29:12 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-10-18 05:29:12 +0000 |
commit | 1953ace81d3121808967a7fa47ad6d631499933d (patch) | |
tree | 4b60c184edfb34fb457154aff1d24702a916b933 /test/Transforms | |
parent | 6ebddd2d6558211a5e4a76b5906633b431e12006 (diff) | |
download | llvm-1953ace81d3121808967a7fa47ad6d631499933d.tar.gz llvm-1953ace81d3121808967a7fa47ad6d631499933d.tar.bz2 llvm-1953ace81d3121808967a7fa47ad6d631499933d.tar.xz |
Vectorizer: Add support for loops with an unknown count. For example:
for (i=0; i<n; i++){
a[i] = b[i+1] + c[i+3];
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/LoopVectorize/gcc-examples.ll | 6 | ||||
-rw-r--r-- | test/Transforms/LoopVectorize/non-const-n.ll | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/test/Transforms/LoopVectorize/gcc-examples.ll b/test/Transforms/LoopVectorize/gcc-examples.ll index 68eab9bae7..4e9e6f940e 100644 --- a/test/Transforms/LoopVectorize/gcc-examples.ll +++ b/test/Transforms/LoopVectorize/gcc-examples.ll @@ -45,9 +45,8 @@ define void @example1() nounwind uwtable ssp { ret void } -; We can't vectorize this loop because it has non constant loop bounds. ;CHECK: @example2 -;CHECK-NOT: <4 x i32> +;CHECK: store <4 x i32> ;CHECK: ret void define void @example2(i32 %n, i32 %x) nounwind uwtable ssp { %1 = icmp sgt i32 %n, 0 @@ -114,9 +113,8 @@ define void @example3(i32 %n, i32* noalias nocapture %p, i32* noalias nocapture ret void } -; We can't vectorize this loop because it has non constant loop bounds. ;CHECK: @example4 -;CHECK-NOT: <4 x i32> +;CHECK: load <4 x i32> ;CHECK: ret void define void @example4(i32 %n, i32* noalias nocapture %p, i32* noalias nocapture %q) nounwind uwtable ssp { %1 = add nsw i32 %n, -1 diff --git a/test/Transforms/LoopVectorize/non-const-n.ll b/test/Transforms/LoopVectorize/non-const-n.ll index 76835b7660..04c5c84a4f 100644 --- a/test/Transforms/LoopVectorize/non-const-n.ll +++ b/test/Transforms/LoopVectorize/non-const-n.ll @@ -9,7 +9,7 @@ target triple = "x86_64-apple-macosx10.8.0" ;CHECK: @example1 ;CHECK: shl i32 -;CHECK: sext i32 +;CHECK: zext i32 ;CHECK: load <4 x i32> ;CHECK: add <4 x i32> ;CHECK: store <4 x i32> |