93 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 52; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s3define void @test1(ptr %x, ptr %y) {4; CHECK-LABEL: 'test1'5; CHECK-NEXT: Classifying expressions for: @test16; CHECK-NEXT: %v1.0 = phi i32 [ 0, %entry ], [ %k.0, %if.end ]7; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%for.cond> U: [0,7) S: [0,7) Exits: 6 LoopDispositions: { %for.cond: Computable }8; CHECK-NEXT: %add = add nsw i32 %v1.0, 19; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.cond> U: [1,8) S: [1,8) Exits: 7 LoopDispositions: { %for.cond: Computable }10; CHECK-NEXT: %add6 = add nsw i32 %v1.0, 111; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.cond> U: [1,8) S: [1,8) Exits: 7 LoopDispositions: { %for.cond: Computable }12; CHECK-NEXT: %k.0 = phi i32 [ %add, %if.then ], [ %add6, %if.else ]13; 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: @test115; CHECK-NEXT: Loop %for.cond: backedge-taken count is i32 616; CHECK-NEXT: Loop %for.cond: constant max backedge-taken count is i32 617; CHECK-NEXT: Loop %for.cond: symbolic max backedge-taken count is i32 618; CHECK-NEXT: Loop %for.cond: Trip multiple is 719;20entry:21 br label %for.cond22 23for.cond: ; preds = %6, %024 %v1.0 = phi i32 [ 0, %entry ], [ %k.0, %if.end ]25 %cmp = icmp slt i32 %v1.0, 626 br i1 %cmp, label %for.body, label %exit27 28for.body: ; preds = %129 %cmp3 = icmp slt i32 %v1.0, 230 br i1 %cmp3, label %if.then, label %if.else31 32if.then: ; preds = %233 %add = add nsw i32 %v1.0, 134 br label %if.end35 36if.else: ; preds = %237 %add6 = add nsw i32 %v1.0, 138 br label %if.end39 40if.end: ; preds = %4, %341 %k.0 = phi i32 [ %add, %if.then ], [ %add6, %if.else ]42 br label %for.cond43 44exit: ; preds = %545 ret void46}47 48define void @test2(ptr %x, ptr %y) {49; CHECK-LABEL: 'test2'50; CHECK-NEXT: Classifying expressions for: @test251; 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, 154; 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, 156; 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: @test260; CHECK-NEXT: Loop %for.cond: backedge-taken count is i32 661; CHECK-NEXT: Loop %for.cond: constant max backedge-taken count is i32 662; CHECK-NEXT: Loop %for.cond: symbolic max backedge-taken count is i32 663; CHECK-NEXT: Loop %for.cond: Trip multiple is 764;65entry:66 br label %for.cond67 68for.cond: ; preds = %6, %069 %v1.0 = phi i32 [ 0, %entry ], [ %k.0, %if.end ]70 %cmp = icmp slt i32 %v1.0, 671 br i1 %cmp, label %for.body, label %exit72 73for.body: ; preds = %174 %cmp3 = icmp slt i32 %v1.0, 275 br i1 %cmp3, label %if.then, label %if.else76 77if.then: ; preds = %278 %add = add nuw i32 %v1.0, 179 br label %if.end80 81if.else: ; preds = %282 %add6 = add nsw i32 %v1.0, 183 br label %if.end84 85if.end: ; preds = %4, %386 %k.0 = phi i32 [ %add, %if.then ], [ %add6, %if.else ]87 br label %for.cond88 89exit: ; preds = %590 ret void91}92 93