11; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
22; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s
3- define void @test (ptr %x , ptr %y ) {
4- ; CHECK-LABEL: 'test '
5- ; CHECK-NEXT: Classifying expressions for: @test
3+ define void @test1 (ptr %x , ptr %y ) {
4+ ; CHECK-LABEL: 'test1 '
5+ ; CHECK-NEXT: Classifying expressions for: @test1
66; CHECK-NEXT: %v1.0 = phi i32 [ 0, %entry ], [ %k.0, %if.end ]
77; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%for.cond> U: [0,7) S: [0,7) Exits: 6 LoopDispositions: { %for.cond: Computable }
88; CHECK-NEXT: %add = add nsw i32 %v1.0, 1
@@ -11,7 +11,7 @@ define void @test(ptr %x, ptr %y) {
1111; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.cond> U: [1,8) S: [1,8) Exits: 7 LoopDispositions: { %for.cond: Computable }
1212; CHECK-NEXT: %k.0 = phi i32 [ %add, %if.then ], [ %add6, %if.else ]
1313; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.cond> U: [1,8) S: [1,8) Exits: 7 LoopDispositions: { %for.cond: Computable }
14- ; CHECK-NEXT: Determining loop execution counts for: @test
14+ ; CHECK-NEXT: Determining loop execution counts for: @test1
1515; CHECK-NEXT: Loop %for.cond: backedge-taken count is i32 6
1616; CHECK-NEXT: Loop %for.cond: constant max backedge-taken count is i32 6
1717; CHECK-NEXT: Loop %for.cond: symbolic max backedge-taken count is i32 6
@@ -44,3 +44,49 @@ if.end: ; preds = %4, %3
4444exit: ; preds = %5
4545 ret void
4646}
47+
48+ define void @test2 (ptr %x , ptr %y ) {
49+ ; CHECK-LABEL: 'test2'
50+ ; CHECK-NEXT: Classifying expressions for: @test2
51+ ; CHECK-NEXT: %v1.0 = phi i32 [ 0, %entry ], [ %k.0, %if.end ]
52+ ; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%for.cond> U: [0,7) S: [0,7) Exits: 6 LoopDispositions: { %for.cond: Computable }
53+ ; CHECK-NEXT: %add = add nuw i32 %v1.0, 1
54+ ; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.cond> U: [1,8) S: [1,8) Exits: 7 LoopDispositions: { %for.cond: Computable }
55+ ; CHECK-NEXT: %add6 = add nsw i32 %v1.0, 1
56+ ; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.cond> U: [1,8) S: [1,8) Exits: 7 LoopDispositions: { %for.cond: Computable }
57+ ; CHECK-NEXT: %k.0 = phi i32 [ %add, %if.then ], [ %add6, %if.else ]
58+ ; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.cond> U: [1,8) S: [1,8) Exits: 7 LoopDispositions: { %for.cond: Computable }
59+ ; CHECK-NEXT: Determining loop execution counts for: @test2
60+ ; CHECK-NEXT: Loop %for.cond: backedge-taken count is i32 6
61+ ; CHECK-NEXT: Loop %for.cond: constant max backedge-taken count is i32 6
62+ ; CHECK-NEXT: Loop %for.cond: symbolic max backedge-taken count is i32 6
63+ ; CHECK-NEXT: Loop %for.cond: Trip multiple is 7
64+ ;
65+ entry:
66+ br label %for.cond
67+
68+ for.cond: ; preds = %6, %0
69+ %v1.0 = phi i32 [ 0 , %entry ], [ %k.0 , %if.end ]
70+ %cmp = icmp slt i32 %v1.0 , 6
71+ br i1 %cmp , label %for.body , label %exit
72+
73+ for.body: ; preds = %1
74+ %cmp3 = icmp slt i32 %v1.0 , 2
75+ br i1 %cmp3 , label %if.then , label %if.else
76+
77+ if.then: ; preds = %2
78+ %add = add nuw i32 %v1.0 , 1
79+ br label %if.end
80+
81+ if.else: ; preds = %2
82+ %add6 = add nsw i32 %v1.0 , 1
83+ br label %if.end
84+
85+ if.end: ; preds = %4, %3
86+ %k.0 = phi i32 [ %add , %if.then ], [ %add6 , %if.else ]
87+ br label %for.cond
88+
89+ exit: ; preds = %5
90+ ret void
91+ }
92+
0 commit comments