[llvm] r194147 - Add test case for PR12377, it was fixed by r194116.
Benjamin Kramer
benny.kra at googlemail.com
Wed Nov 6 03:55:41 PST 2013
Author: d0k
Date: Wed Nov 6 05:55:41 2013
New Revision: 194147
URL: http://llvm.org/viewvc/llvm-project?rev=194147&view=rev
Log:
Add test case for PR12377, it was fixed by r194116.
Modified:
llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_1.ll
Modified: llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_1.ll?rev=194147&r1=194146&r2=194147&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_1.ll (original)
+++ llvm/trunk/test/Transforms/IndVarSimplify/loop_evaluate_1.ll Wed Nov 6 05:55:41 2013
@@ -1,8 +1,9 @@
-; RUN: opt < %s -indvars -loop-deletion -simplifycfg -S | not grep br
-;
-; Testcase distilled from 256.bzip2
+; RUN: opt < %s -indvars -loop-deletion -simplifycfg -S | FileCheck %s
-define i32 @main() {
+; Testcase distilled from 256.bzip2
+; CHECK-LABEL: @test1
+; CHECK-NOT: br
+define i32 @test1() {
entry:
br label %loopentry
@@ -19,3 +20,28 @@ loopexit: ; preds = %loope
ret i32 %tmp.2
}
+
+; PR12377
+; CHECK-LABEL: @test2
+; CHECK: [[VAR1:%.+]] = add i32 %arg, -11
+; CHECK: [[VAR2:%.+]] = lshr i32 [[VAR1]], 1
+; CHECK: [[VAR3:%.+]] = add i32 [[VAR2]], 1
+; CHECK: [[VAR4:%.+]] = phi i32 [ 0, %bb ], [ [[VAR3]], %bb1.preheader ]
+; CHECK: ret i32 [[VAR4]]
+define i32 @test2(i32 %arg) {
+bb:
+ %tmp = icmp ugt i32 %arg, 10
+ br i1 %tmp, label %bb1, label %bb7
+
+bb1: ; preds = %bb1, %bb
+ %tmp2 = phi i32 [ %tmp5, %bb1 ], [ 0, %bb ]
+ %tmp3 = phi i32 [ %tmp4, %bb1 ], [ %arg, %bb ]
+ %tmp4 = add i32 %tmp3, -2
+ %tmp5 = add i32 %tmp2, 1
+ %tmp6 = icmp ugt i32 %tmp4, 10
+ br i1 %tmp6, label %bb1, label %bb7
+
+bb7: ; preds = %bb1, %bb
+ %tmp8 = phi i32 [ 0, %bb ], [ %tmp5, %bb1 ]
+ ret i32 %tmp8
+}
More information about the llvm-commits
mailing list