diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2008-12-16 08:30:01 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2008-12-16 08:30:01 +0000 |
commit | 1447f5ca1f59fdbe885df36c74e868267297a59d (patch) | |
tree | d69fcbdd528d8f308eb77297d4af98e448f35645 /test/Analysis | |
parent | 5a6bb6ae78fb42bedd8987ccd611abd0a548edbf (diff) | |
download | external_llvm-1447f5ca1f59fdbe885df36c74e868267297a59d.zip external_llvm-1447f5ca1f59fdbe885df36c74e868267297a59d.tar.gz external_llvm-1447f5ca1f59fdbe885df36c74e868267297a59d.tar.bz2 |
Generalize support for analyzing loops to include SLE/SGE loop exit conditions
and support for non-unit strides with signed exit conditions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61082 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
4 files changed, 41 insertions, 2 deletions
diff --git a/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll b/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll index 1bf24d7..a9a7c05 100644 --- a/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll +++ b/test/Analysis/ScalarEvolution/2008-12-08-FiniteSGE.ll @@ -1,5 +1,4 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {255 iterations} -; XFAIL: * define i32 @foo(i32 %x, i32 %y, i32* %lam, i32* %alp) nounwind { bb1.thread: diff --git a/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll b/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll index 9703bcb..1e8787d 100644 --- a/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll +++ b/test/Analysis/ScalarEvolution/2008-12-11-SMaxOverflow.ll @@ -1,5 +1,4 @@ ; RUN: llvm-as < %s | opt -analyze -scalar-evolution | grep {0 smax} -; XFAIL: * define i32 @f(i32 %c.idx.val) { diff --git a/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll b/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll new file mode 100644 index 0000000..e1f2da4 --- /dev/null +++ b/test/Analysis/ScalarEvolution/2008-12-14-StrideAndSigned.ll @@ -0,0 +1,21 @@ +; RUN: llvm-as < %s | opt -analyze -scalar-evolution |& \ +; RUN: grep {(((-1 \\* %i0) + (100005 smax %i0)) /u 5)} + +define i32 @foo0(i32 %i0) nounwind { +entry: + br label %bb1 + +bb: ; preds = %bb1 + %0 = add i32 %j.0, 1 ; <i32> [#uses=1] + %1 = add i32 %i.0, 5 ; <i32> [#uses=1] + br label %bb1 + +bb1: ; preds = %bb, %entry + %j.0 = phi i32 [ 0, %entry ], [ %0, %bb ] ; <i32> [#uses=2] + %i.0 = phi i32 [ %i0, %entry ], [ %1, %bb ] ; <i32> [#uses=2] + %2 = icmp sgt i32 %i.0, 100000 ; <i1> [#uses=1] + br i1 %2, label %return, label %bb + +return: ; preds = %bb1 + ret i32 %j.0 +} diff --git a/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll b/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll new file mode 100644 index 0000000..ad8914e --- /dev/null +++ b/test/Analysis/ScalarEvolution/2008-12-15-DontUseSDiv.ll @@ -0,0 +1,20 @@ +; RUN: llvm-as < %s | opt -analyze -scalar-evolution |& grep {/u 5} + +define i8 @foo0(i8 %i0) nounwind { +entry: + br label %bb1 + +bb: ; preds = %bb1 + %0 = add i8 %j.0, 1 ; <i8> [#uses=1] + %1 = add i8 %i.0, 5 ; <i8> [#uses=1] + br label %bb1 + +bb1: ; preds = %bb, %entry + %j.0 = phi i8 [ 0, %entry ], [ %0, %bb ] ; <i8> [#uses=2] + %i.0 = phi i8 [ %i0, %entry ], [ %1, %bb ] ; <i8> [#uses=2] + %2 = icmp sgt i8 %i.0, 100 ; <i1> [#uses=1] + br i1 %2, label %return, label %bb + +return: ; preds = %bb1 + ret i8 %j.0 +} |