77 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt -disable-output "-passes=print<scalar-evolution>" %s 2>&1 | FileCheck %s3 4target triple = "x86_64-unknown-linux-gnu"5 6define void @test_and(i16 %in) {7; CHECK-LABEL: 'test_and'8; CHECK-NEXT: Classifying expressions for: @test_and9; CHECK-NEXT: %_tmp25.i = phi i16 [ %in, %bb2 ], [ %_tmp6.i, %bb1.i ]10; CHECK-NEXT: --> {%in,+,1}<nsw><%bb1.i> U: full-set S: full-set Exits: 1 LoopDispositions: { %bb1.i: Computable, %bb2: Variant }11; CHECK-NEXT: %_tmp6.i = add nsw i16 %_tmp25.i, 112; CHECK-NEXT: --> {(1 + %in),+,1}<nsw><%bb1.i> U: full-set S: full-set Exits: 2 LoopDispositions: { %bb1.i: Computable, %bb2: Variant }13; CHECK-NEXT: %or.cond = and i1 %_tmp10.i, %exitcond.i14; CHECK-NEXT: --> (%_tmp10.i umin %exitcond.i) U: full-set S: full-set Exits: true LoopDispositions: { %bb1.i: Variant, %bb2: Variant }15; CHECK-NEXT: Determining loop execution counts for: @test_and16; CHECK-NEXT: Loop %bb1.i: backedge-taken count is (1 + (-1 * %in))17; CHECK-NEXT: Loop %bb1.i: constant max backedge-taken count is i16 -118; CHECK-NEXT: Loop %bb1.i: symbolic max backedge-taken count is (1 + (-1 * %in))19; CHECK-NEXT: Loop %bb1.i: Trip multiple is 120; CHECK-NEXT: Loop %bb2: <multiple exits> Unpredictable backedge-taken count.21; CHECK-NEXT: Loop %bb2: Unpredictable constant max backedge-taken count.22; CHECK-NEXT: Loop %bb2: Unpredictable symbolic max backedge-taken count.23;24 br label %bb225 26bb2: ; preds = %bb1.i, %bb2, %027 %_tmp44.i = icmp slt i16 %in, 228 br i1 %_tmp44.i, label %bb1.i, label %bb229 30bb1.i: ; preds = %bb1.i, %bb231 %_tmp25.i = phi i16 [ %in, %bb2 ], [ %_tmp6.i, %bb1.i ]32 %_tmp6.i = add nsw i16 %_tmp25.i, 133 %_tmp10.i = icmp sge i16 %_tmp6.i, 234 %exitcond.i = icmp eq i16 %_tmp6.i, 235 %or.cond = and i1 %_tmp10.i, %exitcond.i36 br i1 %or.cond, label %bb2, label %bb1.i37}38 39define void @test_or() {40; CHECK-LABEL: 'test_or'41; CHECK-NEXT: Classifying expressions for: @test_or42; CHECK-NEXT: %indvars.iv = phi i64 [ -1, %BB ], [ -1, %0 ]43; CHECK-NEXT: --> -1 U: [-1,0) S: [-1,0) Exits: -1 LoopDispositions: { %BB: Invariant }44; CHECK-NEXT: %sum.01 = phi i32 [ %2, %BB ], [ undef, %0 ]45; CHECK-NEXT: --> {undef,+,-1}<%BB> U: full-set S: full-set Exits: 0 LoopDispositions: { %BB: Computable }46; CHECK-NEXT: %1 = trunc i64 %indvars.iv to i3247; CHECK-NEXT: --> -1 U: [-1,0) S: [-1,0) Exits: -1 LoopDispositions: { %BB: Invariant }48; CHECK-NEXT: %2 = add nsw i32 %1, %sum.0149; CHECK-NEXT: --> {(-1 + undef),+,-1}<%BB> U: full-set S: full-set Exits: -1 LoopDispositions: { %BB: Computable }50; CHECK-NEXT: %B3 = add i32 %1, %251; CHECK-NEXT: --> {(-2 + undef),+,-1}<%BB> U: full-set S: full-set Exits: -2 LoopDispositions: { %BB: Computable }52; CHECK-NEXT: %B = or i1 %C5, %C1153; CHECK-NEXT: --> (%C11 umax %C5) U: full-set S: full-set Exits: false LoopDispositions: { %BB: Variant }54; CHECK-NEXT: Determining loop execution counts for: @test_or55; CHECK-NEXT: Loop %BB: backedge-taken count is undef56; CHECK-NEXT: Loop %BB: constant max backedge-taken count is i32 -157; CHECK-NEXT: Loop %BB: symbolic max backedge-taken count is undef58; CHECK-NEXT: Loop %BB: Trip multiple is 159;60 %C10 = icmp slt i1 undef, undef61 br i1 %C10, label %BB, label %exit62 63BB: ; preds = %BB, %064 %indvars.iv = phi i64 [ -1, %BB ], [ -1, %0 ]65 %sum.01 = phi i32 [ %2, %BB ], [ undef, %0 ]66 %1 = trunc i64 %indvars.iv to i3267 %2 = add nsw i32 %1, %sum.0168 %B3 = add i32 %1, %269 %C11 = icmp ult i32 %2, %170 %C5 = icmp sle i32 %1, %B371 %B = or i1 %C5, %C1172 br i1 %B, label %BB, label %exit73 74exit: ; preds = %BB, %075 ret void76}77