[llvm-commits] [llvm] r41146 - in /llvm/trunk/test/Transforms/LoopIndexSplit: ./ Crash-2007-08-17.ll Crash2-2007-08-17.ll OneIterLoop-2007-08-17.ll OneIterLoop2-2007-08-17.ll OneIterLoop3-2007-08-17.ll Output/ SaveLastValue-2007-08-17.ll dg.exp
Devang Patel
dpatel at apple.com
Fri Aug 17 15:02:16 PDT 2007
Author: dpatel
Date: Fri Aug 17 17:02:15 2007
New Revision: 41146
URL: http://llvm.org/viewvc/llvm-project?rev=41146&view=rev
Log:
Add loop index split tests.
Added:
llvm/trunk/test/Transforms/LoopIndexSplit/
llvm/trunk/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll
llvm/trunk/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll
llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll
llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll
llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll
llvm/trunk/test/Transforms/LoopIndexSplit/Output/
llvm/trunk/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll
llvm/trunk/test/Transforms/LoopIndexSplit/dg.exp
Added: llvm/trunk/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll?rev=41146&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll (added)
+++ llvm/trunk/test/Transforms/LoopIndexSplit/Crash-2007-08-17.ll Fri Aug 17 17:02:15 2007
@@ -0,0 +1,53 @@
+; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
+; RUN: grep "loop-index-split" | count 1
+
+ %struct._edit_script = type { %struct._edit_script*, i32, i8 }
+
+define void @align_path(i8* %seq1, i8* %seq2, i32 %i1, i32 %j1, i32 %i2, i32 %j2, i32 %dist, %struct._edit_script** %head, %struct._edit_script** %tail, i32 %M, i32 %N) {
+entry:
+ br label %bb354
+
+bb354: ; preds = %bb511, %entry
+ br i1 false, label %bb495, label %bb368
+
+bb368: ; preds = %bb354
+ ret void
+
+bb495: ; preds = %bb495, %bb354
+ br i1 false, label %bb511, label %bb495
+
+bb511: ; preds = %bb495
+ br i1 false, label %xmalloc.exit69, label %bb354
+
+xmalloc.exit69: ; preds = %bb511
+ br i1 false, label %bb556, label %bb542.preheader
+
+bb542.preheader: ; preds = %xmalloc.exit69
+ ret void
+
+bb556: ; preds = %xmalloc.exit69
+ br label %bb583
+
+bb583: ; preds = %cond_next693, %bb556
+ %k.4342.0 = phi i32 [ %tmp707, %cond_next693 ], [ 0, %bb556 ] ; <i32> [#uses=2]
+ %tmp586 = icmp eq i32 %k.4342.0, 0 ; <i1> [#uses=1]
+ br i1 %tmp586, label %cond_true589, label %cond_false608
+
+cond_true589: ; preds = %bb583
+ br label %cond_next693
+
+cond_false608: ; preds = %bb583
+ br i1 false, label %cond_next661, label %cond_next693
+
+cond_next661: ; preds = %cond_false608
+ br label %cond_next693
+
+cond_next693: ; preds = %cond_next661, %cond_false608, %cond_true589
+ %tmp705 = getelementptr i32* null, i32 0 ; <i32*> [#uses=0]
+ %tmp707 = add i32 %k.4342.0, 1 ; <i32> [#uses=2]
+ %tmp711 = icmp sgt i32 %tmp707, 0 ; <i1> [#uses=1]
+ br i1 %tmp711, label %bb726.preheader, label %bb583
+
+bb726.preheader: ; preds = %cond_next693
+ ret void
+}
Added: llvm/trunk/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll?rev=41146&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll (added)
+++ llvm/trunk/test/Transforms/LoopIndexSplit/Crash2-2007-08-17.ll Fri Aug 17 17:02:15 2007
@@ -0,0 +1,59 @@
+; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
+; RUN: grep "loop-index-split" | count 1
+
+ %struct._edit_script = type { %struct._edit_script*, i32, i8 }
+
+define void @align_path(i8* %seq1, i8* %seq2, i32 %i1, i32 %j1, i32 %i2, i32 %j2, i32 %dist, %struct._edit_script** %head, %struct._edit_script** %tail, i32 %M, i32 %N) {
+entry:
+ br label %bb354
+
+bb354: ; preds = %bb511, %entry
+ br i1 false, label %bb495, label %bb368
+
+bb368: ; preds = %bb354
+ ret void
+
+bb495: ; preds = %bb495, %bb354
+ br i1 false, label %bb511, label %bb495
+
+bb511: ; preds = %bb495
+ br i1 false, label %xmalloc.exit69, label %bb354
+
+xmalloc.exit69: ; preds = %bb511
+ br i1 false, label %bb556, label %bb542.preheader
+
+bb542.preheader: ; preds = %xmalloc.exit69
+ ret void
+
+bb556: ; preds = %xmalloc.exit69
+ br label %bb583
+
+bb583: ; preds = %cond_next693, %bb556
+ %k.4342.0 = phi i32 [ %tmp707, %cond_next693 ], [ 0, %bb556 ] ; <i32> [#uses=2]
+ %tmp586 = icmp eq i32 %k.4342.0, 0 ; <i1> [#uses=1]
+ br i1 %tmp586, label %cond_true589, label %cond_false608
+
+cond_true589: ; preds = %bb583
+ br label %cond_next693
+
+cond_false608: ; preds = %bb583
+ br i1 false, label %bb645, label %cond_next693
+
+bb645: ; preds = %cond_false608
+ br i1 false, label %bb684, label %cond_next661
+
+cond_next661: ; preds = %bb645
+ br i1 false, label %bb684, label %cond_next693
+
+bb684: ; preds = %cond_next661, %bb645
+ br label %cond_next693
+
+cond_next693: ; preds = %bb684, %cond_next661, %cond_false608, %cond_true589
+ %tmp705 = getelementptr i32* null, i32 0 ; <i32*> [#uses=0]
+ %tmp707 = add i32 %k.4342.0, 1 ; <i32> [#uses=2]
+ %tmp711 = icmp sgt i32 %tmp707, 0 ; <i1> [#uses=1]
+ br i1 %tmp711, label %bb726.preheader, label %bb583
+
+bb726.preheader: ; preds = %cond_next693
+ ret void
+}
Added: llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll?rev=41146&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll (added)
+++ llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop-2007-08-17.ll Fri Aug 17 17:02:15 2007
@@ -0,0 +1,61 @@
+; Loop is elimianted
+; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
+; RUN: grep "loop-index-split" | count 1
+ %struct.anon = type { i32 }
+ at S1 = external global i32 ; <i32*> [#uses=1]
+ at W1 = external global i32 ; <i32*> [#uses=1]
+ at Y = weak global [100 x %struct.anon] zeroinitializer, align 32 ; <[100 x %struct.anon]*> [#uses=1]
+ at ti = external global i32 ; <i32*> [#uses=1]
+ at T2 = external global [100 x [100 x i32]] ; <[100 x [100 x i32]]*> [#uses=1]
+ at d = external global i32 ; <i32*> [#uses=1]
+ at T1 = external global i32 ; <i32*> [#uses=2]
+ at N2 = external global i32 ; <i32*> [#uses=2]
+
+define void @foo() {
+entry:
+ %tmp = load i32* @S1, align 4 ; <i32> [#uses=2]
+ %tmp266 = load i32* @N2, align 4 ; <i32> [#uses=1]
+ %tmp288 = icmp ult i32 %tmp, %tmp266 ; <i1> [#uses=1]
+ br i1 %tmp288, label %bb.preheader, label %return
+
+bb.preheader: ; preds = %entry
+ %tmp1 = load i32* @W1, align 4 ; <i32> [#uses=1]
+ %tmp13 = load i32* @ti, align 4 ; <i32> [#uses=1]
+ %tmp18 = load i32* @d, align 4 ; <i32> [#uses=1]
+ %tmp26 = load i32* @N2, align 4 ; <i32> [#uses=1]
+ %T1.promoted = load i32* @T1 ; <i32> [#uses=1]
+ br label %bb
+
+bb: ; preds = %bb.preheader, %bb25
+ %T1.tmp.1 = phi i32 [ %T1.promoted, %bb.preheader ], [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=3]
+ %tj.01.0 = phi i32 [ %tmp24, %bb25 ], [ %tmp, %bb.preheader ] ; <i32> [#uses=4]
+ %tmp3 = icmp eq i32 %tj.01.0, %tmp1 ; <i1> [#uses=1]
+ br i1 %tmp3, label %cond_true, label %bb25
+
+cond_true: ; preds = %bb
+ %tmp7 = getelementptr [100 x %struct.anon]* @Y, i32 0, i32 %tj.01.0, i32 0 ; <i32*> [#uses=1]
+ %tmp8 = load i32* %tmp7, align 4 ; <i32> [#uses=1]
+ %tmp9 = icmp sgt i32 %tmp8, 0 ; <i1> [#uses=1]
+ br i1 %tmp9, label %cond_true12, label %bb25
+
+cond_true12: ; preds = %cond_true
+ %tmp16 = getelementptr [100 x [100 x i32]]* @T2, i32 0, i32 %tmp13, i32 %tj.01.0 ; <i32*> [#uses=1]
+ %tmp17 = load i32* %tmp16, align 4 ; <i32> [#uses=1]
+ %tmp19 = mul i32 %tmp18, %tmp17 ; <i32> [#uses=1]
+ %tmp21 = add i32 %tmp19, %T1.tmp.1 ; <i32> [#uses=1]
+ br label %bb25
+
+bb25: ; preds = %cond_true, %bb, %cond_true12
+ %T1.tmp.0 = phi i32 [ %T1.tmp.1, %bb ], [ %T1.tmp.1, %cond_true ], [ %tmp21, %cond_true12 ] ; <i32> [#uses=2]
+ %tmp24 = add i32 %tj.01.0, 1 ; <i32> [#uses=2]
+ %tmp28 = icmp ult i32 %tmp24, %tmp26 ; <i1> [#uses=1]
+ br i1 %tmp28, label %bb, label %return.loopexit
+
+return.loopexit: ; preds = %bb25
+ %T1.tmp.0.lcssa = phi i32 [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=1]
+ store i32 %T1.tmp.0.lcssa, i32* @T1
+ br label %return
+
+return: ; preds = %return.loopexit, %entry
+ ret void
+}
Added: llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll?rev=41146&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll (added)
+++ llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop2-2007-08-17.ll Fri Aug 17 17:02:15 2007
@@ -0,0 +1,62 @@
+; Loop is elimianted. Save last value assignment.
+; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
+; RUN: grep "loop-index-split" | count 1
+
+ %struct.anon = type { i32 }
+ at S1 = external global i32 ; <i32*> [#uses=1]
+ at W1 = external global i32 ; <i32*> [#uses=1]
+ at Y = weak global [100 x %struct.anon] zeroinitializer, align 32 ; <[100 x %struct.anon]*> [#uses=1]
+ at ti = external global i32 ; <i32*> [#uses=1]
+ at T2 = external global [100 x [100 x i32]] ; <[100 x [100 x i32]]*> [#uses=1]
+ at d = external global i32 ; <i32*> [#uses=1]
+ at T1 = external global i32 ; <i32*> [#uses=2]
+ at N1 = external global i32 ; <i32*> [#uses=2]
+
+define void @foo() {
+entry:
+ %tmp = load i32* @S1, align 4 ; <i32> [#uses=2]
+ %tmp266 = load i32* @N1, align 4 ; <i32> [#uses=1]
+ %tmp288 = icmp ult i32 %tmp, %tmp266 ; <i1> [#uses=1]
+ br i1 %tmp288, label %bb.preheader, label %return
+
+bb.preheader: ; preds = %entry
+ %tmp1 = load i32* @W1, align 4 ; <i32> [#uses=1]
+ %tmp13 = load i32* @ti, align 4 ; <i32> [#uses=1]
+ %tmp18 = load i32* @d, align 4 ; <i32> [#uses=1]
+ %tmp26 = load i32* @N1, align 4 ; <i32> [#uses=1]
+ %T1.promoted = load i32* @T1 ; <i32> [#uses=1]
+ br label %bb
+
+bb: ; preds = %bb.preheader, %bb25
+ %T1.tmp.1 = phi i32 [ %T1.promoted, %bb.preheader ], [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=3]
+ %tj.01.0 = phi i32 [ %tmp24, %bb25 ], [ %tmp, %bb.preheader ] ; <i32> [#uses=4]
+ %tmp24 = add i32 %tj.01.0, 1 ; <i32> [#uses=2]
+ %tmp3 = icmp eq i32 %tmp24, %tmp1 ; <i1> [#uses=1]
+ br i1 %tmp3, label %cond_true, label %bb25
+
+cond_true: ; preds = %bb
+ %tmp7 = getelementptr [100 x %struct.anon]* @Y, i32 0, i32 %tj.01.0, i32 0 ; <i32*> [#uses=1]
+ %tmp8 = load i32* %tmp7, align 4 ; <i32> [#uses=1]
+ %tmp9 = icmp sgt i32 %tmp8, 0 ; <i1> [#uses=1]
+ br i1 %tmp9, label %cond_true12, label %bb25
+
+cond_true12: ; preds = %cond_true
+ %tmp16 = getelementptr [100 x [100 x i32]]* @T2, i32 0, i32 %tmp13, i32 %tj.01.0 ; <i32*> [#uses=1]
+ %tmp17 = load i32* %tmp16, align 4 ; <i32> [#uses=1]
+ %tmp19 = mul i32 %tmp18, %tmp17 ; <i32> [#uses=1]
+ %tmp21 = add i32 %tmp19, %T1.tmp.1 ; <i32> [#uses=1]
+ br label %bb25
+
+bb25: ; preds = %cond_true, %bb, %cond_true12
+ %T1.tmp.0 = phi i32 [ %T1.tmp.1, %bb ], [ %T1.tmp.1, %cond_true ], [ %tmp21, %cond_true12 ] ; <i32> [#uses=2]
+ %tmp28 = icmp ult i32 %tmp24, %tmp26 ; <i1> [#uses=1]
+ br i1 %tmp28, label %bb, label %return.loopexit
+
+return.loopexit: ; preds = %bb25
+ %T1.tmp.0.lcssa = phi i32 [ %T1.tmp.0, %bb25 ] ; <i32> [#uses=1]
+ store i32 %T1.tmp.0.lcssa, i32* @T1
+ br label %return
+
+return: ; preds = %return.loopexit, %entry
+ ret void
+}
Added: llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll?rev=41146&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll (added)
+++ llvm/trunk/test/Transforms/LoopIndexSplit/OneIterLoop3-2007-08-17.ll Fri Aug 17 17:02:15 2007
@@ -0,0 +1,35 @@
+; Loop is elimianted. Save last value assignments, including induction variable.
+; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
+; RUN: grep "loop-index-split" | count 1
+
+declare i32 @foo(i32)
+declare i32 @bar(i32, i32)
+
+define void @foobar(i32 %a, i32 %b) {
+entry:
+ br label %bb
+
+bb: ; preds = %cond_next, %entry
+ %i.01.0 = phi i32 [ 0, %entry ], [ %tmp8, %cond_next ] ; <i32> [#uses=3]
+ %tsum.16.0 = phi i32 [ 42, %entry ], [ %tsum.0, %cond_next ] ; <i32> [#uses=2]
+ %tmp1 = icmp eq i32 %i.01.0, 50 ; <i1> [#uses=1]
+ br i1 %tmp1, label %cond_true, label %cond_next
+
+cond_true: ; preds = %bb
+ %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1]
+ %tmp6 = add i32 %tmp4, %tsum.16.0 ; <i32> [#uses=1]
+ br label %cond_next
+
+cond_next: ; preds = %bb, %cond_true
+ %tsum.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.16.0, %bb ] ; <i32> [#uses=2]
+ %tmp8 = add i32 %i.01.0, 1 ; <i32> [#uses=3]
+ %tmp11 = icmp slt i32 %tmp8, 100 ; <i1> [#uses=1]
+ br i1 %tmp11, label %bb, label %bb14
+
+bb14: ; preds = %cond_next
+ %tmp8.lcssa = phi i32 [ %tmp8, %cond_next ] ; <i32> [#uses=1]
+ %tsum.0.lcssa = phi i32 [ %tsum.0, %cond_next ] ; <i32> [#uses=1]
+ %tmp17 = tail call i32 @bar( i32 %tmp8.lcssa, i32 %tsum.0.lcssa ) ; <i32> [#uses=0]
+ ret void
+}
+
Added: llvm/trunk/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll?rev=41146&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll (added)
+++ llvm/trunk/test/Transforms/LoopIndexSplit/SaveLastValue-2007-08-17.ll Fri Aug 17 17:02:15 2007
@@ -0,0 +1,52 @@
+; Split loop. Save last value.
+; RUN: llvm-as < %s | opt -loop-index-split -disable-output -stats |& \
+; RUN: grep "loop-index-split" | count 1
+
+ at k = external global i32 ; <i32*> [#uses=2]
+
+define void @foobar(i32 %a, i32 %b) {
+entry:
+ br label %bb
+
+bb: ; preds = %cond_next16, %entry
+ %i.01.0 = phi i32 [ 0, %entry ], [ %tmp18, %cond_next16 ] ; <i32> [#uses=5]
+ %tsum.18.0 = phi i32 [ 42, %entry ], [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=3]
+ %tmp1 = icmp slt i32 %i.01.0, 50 ; <i1> [#uses=1]
+ br i1 %tmp1, label %cond_true, label %cond_false
+
+cond_true: ; preds = %bb
+ %tmp4 = tail call i32 @foo( i32 %i.01.0 ) ; <i32> [#uses=1]
+ %tmp6 = add i32 %tmp4, %tsum.18.0 ; <i32> [#uses=2]
+ %tmp914 = load i32* @k, align 4 ; <i32> [#uses=1]
+ %tmp1015 = icmp eq i32 %tmp914, 0 ; <i1> [#uses=1]
+ br i1 %tmp1015, label %cond_next16, label %cond_true13
+
+cond_false: ; preds = %bb
+ %tmp8 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
+ %tmp9 = load i32* @k, align 4 ; <i32> [#uses=1]
+ %tmp10 = icmp eq i32 %tmp9, 0 ; <i1> [#uses=1]
+ br i1 %tmp10, label %cond_next16, label %cond_true13
+
+cond_true13: ; preds = %cond_false, %cond_true
+ %tsum.013.0 = phi i32 [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=1]
+ %tmp15 = tail call i32 @bar( i32 %i.01.0 ) ; <i32> [#uses=0]
+ br label %cond_next16
+
+cond_next16: ; preds = %cond_false, %cond_true, %cond_true13
+ %tsum.013.1 = phi i32 [ %tsum.013.0, %cond_true13 ], [ %tmp6, %cond_true ], [ %tsum.18.0, %cond_false ] ; <i32> [#uses=2]
+ %tmp18 = add i32 %i.01.0, 1 ; <i32> [#uses=3]
+ %tmp21 = icmp slt i32 %tmp18, 100 ; <i1> [#uses=1]
+ br i1 %tmp21, label %bb, label %bb24
+
+bb24: ; preds = %cond_next16
+ %tmp18.lcssa = phi i32 [ %tmp18, %cond_next16 ] ; <i32> [#uses=1]
+ %tsum.013.1.lcssa = phi i32 [ %tsum.013.1, %cond_next16 ] ; <i32> [#uses=1]
+ %tmp27 = tail call i32 @t( i32 %tmp18.lcssa, i32 %tsum.013.1.lcssa ) ; <i32> [#uses=0]
+ ret void
+}
+
+declare i32 @foo(i32)
+
+declare i32 @bar(i32)
+
+declare i32 @t(i32, i32)
Added: llvm/trunk/test/Transforms/LoopIndexSplit/dg.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopIndexSplit/dg.exp?rev=41146&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/LoopIndexSplit/dg.exp (added)
+++ llvm/trunk/test/Transforms/LoopIndexSplit/dg.exp Fri Aug 17 17:02:15 2007
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,llx,c,cpp,tr}]]
More information about the llvm-commits
mailing list