diff options
author | Devang Patel <dpatel@apple.com> | 2007-07-31 08:04:17 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-07-31 08:04:17 +0000 |
commit | fee0a9c7ef5a55455d5351848207202431e3feda (patch) | |
tree | dc9957ca8b909e7e9f91263ec8d34f9f9203c7bd /test/Transforms/LoopUnswitch | |
parent | c64a1a921ca82c561672f34a2ec9c23b4a590159 (diff) |
Bunch of tests to check loop passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/LoopUnswitch')
-rw-r--r-- | test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll | 45 | ||||
-rw-r--r-- | test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll | 27 |
2 files changed, 72 insertions, 0 deletions
diff --git a/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll b/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll new file mode 100644 index 0000000000..c4080c1e3b --- /dev/null +++ b/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll @@ -0,0 +1,45 @@ +; RUN: llvm-as < %s | opt -loop-unswitch -instcombine -disable-output + +@str3 = external constant [3 x i8] ; <[3 x i8]*> [#uses=1] + +define i32 @stringSearch_Clib(i32 %count) { +entry: + %ttmp25 = icmp sgt i32 %count, 0 ; <i1> [#uses=1] + br i1 %ttmp25, label %bb36.preheader, label %bb44 + +bb36.preheader: ; preds = %entry + %ttmp33 = icmp slt i32 0, 250 ; <i1> [#uses=1] + br label %bb36.outer + +bb36.outer: ; preds = %bb41, %bb36.preheader + br i1 %ttmp33, label %bb.nph, label %bb41 + +bb.nph: ; preds = %bb36.outer + %ttmp8 = icmp eq i8* null, null ; <i1> [#uses=1] + %ttmp6 = icmp eq i8* null, null ; <i1> [#uses=1] + %tmp31 = call i32 @strcspn( i8* null, i8* getelementptr ([3 x i8]* @str3, i64 0, i64 0) ) ; <i32> [#uses=1] + br i1 %ttmp8, label %cond_next, label %cond_true + +cond_true: ; preds = %bb.nph + ret i32 0 + +cond_next: ; preds = %bb.nph + br i1 %ttmp6, label %cond_next28, label %cond_true20 + +cond_true20: ; preds = %cond_next + ret i32 0 + +cond_next28: ; preds = %cond_next + %tmp33 = add i32 %tmp31, 0 ; <i32> [#uses=1] + br label %bb41 + +bb41: ; preds = %cond_next28, %bb36.outer + %c.2.lcssa = phi i32 [ 0, %bb36.outer ], [ %tmp33, %cond_next28 ] ; <i32> [#uses=1] + br i1 false, label %bb36.outer, label %bb44 + +bb44: ; preds = %bb41, %entry + %c.01.1 = phi i32 [ 0, %entry ], [ %c.2.lcssa, %bb41 ] ; <i32> [#uses=1] + ret i32 %c.01.1 +} + +declare i32 @strcspn(i8*, i8*) diff --git a/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll b/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll new file mode 100644 index 0000000000..de3f670f2b --- /dev/null +++ b/test/Transforms/LoopUnswitch/2007-07-13-DomInfo.ll @@ -0,0 +1,27 @@ +; RUN: llvm-as < %s | opt -loop-unswitch -disable-output + +define i32 @main(i32 %argc, i8** %argv) { +entry: + %tmp1785365 = icmp ult i32 0, 100 ; <i1> [#uses=1] + br label %bb + +bb: ; preds = %cond_true, %entry + br i1 false, label %cond_true, label %cond_next + +cond_true: ; preds = %bb + br i1 %tmp1785365, label %bb, label %bb1788 + +cond_next: ; preds = %bb + %iftmp.1.0 = select i1 false, i32 0, i32 0 ; <i32> [#uses=1] + br i1 false, label %cond_true47, label %cond_next74 + +cond_true47: ; preds = %cond_next + %tmp53 = urem i32 %iftmp.1.0, 0 ; <i32> [#uses=0] + ret i32 0 + +cond_next74: ; preds = %cond_next + ret i32 0 + +bb1788: ; preds = %cond_true + ret i32 0 +} |