llvm.org GIT mirror llvm / cdff95b
[IndVarSimplify][NFC] Autogenerate check lines in loop_evaluate_1.ll Being affected by upcoming patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366746 91177308-0d34-0410-b5e6-96231b3b80d8 Roman Lebedev a month ago
1 changed file(s) with 27 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1 ; RUN: opt < %s -indvars -loop-deletion -simplifycfg -S | FileCheck %s
12
23 ; Testcase distilled from 256.bzip2
3 ; CHECK-LABEL: @test1
4 ; CHECK-NOT: br
54 define i32 @test1() {
5 ; CHECK-LABEL: @test1(
6 ; CHECK-NEXT: entry:
7 ; CHECK-NEXT: ret i32 364
8 ;
69 entry:
7 br label %loopentry
10 br label %loopentry
811
912 loopentry: ; preds = %loopentry, %entry
10 %indvar1 = phi i32 [ 0, %entry ], [ %indvar.next2, %loopentry ] ; [#uses=1]
11 %h.0 = phi i32 [ %tmp.2, %loopentry ], [ 4, %entry ] ; [#uses=1]
12 %tmp.1 = mul i32 %h.0, 3 ; [#uses=1]
13 %tmp.2 = add i32 %tmp.1, 1 ; [#uses=2]
14 %indvar.next2 = add i32 %indvar1, 1 ; [#uses=2]
15 %exitcond3 = icmp ne i32 %indvar.next2, 4 ; [#uses=1]
16 br i1 %exitcond3, label %loopentry, label %loopexit
13 %indvar1 = phi i32 [ 0, %entry ], [ %indvar.next2, %loopentry ] ; [#uses=1]
14 %h.0 = phi i32 [ %tmp.2, %loopentry ], [ 4, %entry ] ; [#uses=1]
15 %tmp.1 = mul i32 %h.0, 3 ; [#uses=1]
16 %tmp.2 = add i32 %tmp.1, 1 ; [#uses=2]
17 %indvar.next2 = add i32 %indvar1, 1 ; [#uses=2]
18 %exitcond3 = icmp ne i32 %indvar.next2, 4 ; [#uses=1]
19 br i1 %exitcond3, label %loopentry, label %loopexit
1720
1821 loopexit: ; preds = %loopentry
19 ret i32 %tmp.2
22 ret i32 %tmp.2
2023 }
2124
22
2325 ; PR12377
24 ; CHECK-LABEL: @test2
25 ; CHECK: [[VAR1:%.+]] = add i32 %arg, -11
26 ; CHECK: [[VAR2:%.+]] = lshr i32 [[VAR1]], 1
27 ; CHECK: [[VAR3:%.+]] = add nuw i32 [[VAR2]], 1
28 ; CHECK: [[VAR4:%.+]] = phi i32 [ 0, %bb ], [ [[VAR3]], %bb1.preheader ]
29 ; CHECK: ret i32 [[VAR4]]
3026 define i32 @test2(i32 %arg) {
27 ; CHECK-LABEL: @test2(
28 ; CHECK-NEXT: bb:
29 ; CHECK-NEXT: [[TMP:%.*]] = icmp ugt i32 [[ARG:%.*]], 10
30 ; CHECK-NEXT: br i1 [[TMP]], label [[BB1_PREHEADER:%.*]], label [[BB7:%.*]]
31 ; CHECK: bb1.preheader:
32 ; CHECK-NEXT: [[TMP0:%.*]] = add i32 [[ARG]], -11
33 ; CHECK-NEXT: [[TMP1:%.*]] = lshr i32 [[TMP0]], 1
34 ; CHECK-NEXT: [[TMP2:%.*]] = add nuw i32 [[TMP1]], 1
35 ; CHECK-NEXT: br label [[BB7]]
36 ; CHECK: bb7:
37 ; CHECK-NEXT: [[TMP8:%.*]] = phi i32 [ 0, [[BB:%.*]] ], [ [[TMP2]], [[BB1_PREHEADER]] ]
38 ; CHECK-NEXT: ret i32 [[TMP8]]
39 ;
3140 bb:
3241 %tmp = icmp ugt i32 %arg, 10
3342 br i1 %tmp, label %bb1, label %bb7