51 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 22; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck %s3 4@.str = private unnamed_addr constant [3 x i8] c"%x\00", align 15 6define dso_local i32 @test_loop(ptr nocapture noundef readonly %x) {7; CHECK-LABEL: 'test_loop'8; CHECK-NEXT: Classifying expressions for: @test_loop9; CHECK-NEXT: %i.03 = phi i64 [ 1, %entry ], [ %inc, %for.body ]10; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%for.body> U: [1,10) S: [1,10) Exits: 9 LoopDispositions: { %for.body: Computable }11; CHECK-NEXT: %conv = shl nuw nsw i64 %i.03, 3212; CHECK-NEXT: --> {4294967296,+,4294967296}<nuw><nsw><%for.body> U: [4294967296,38654705665) S: [4294967296,38654705665) Exits: 38654705664 LoopDispositions: { %for.body: Computable }13; CHECK-NEXT: %sext = add nsw i64 %conv, -429496729614; CHECK-NEXT: --> {0,+,4294967296}<nuw><nsw><%for.body> U: [0,34359738369) S: [0,34359738369) Exits: 34359738368 LoopDispositions: { %for.body: Computable }15; CHECK-NEXT: %idxprom = ashr exact i64 %sext, 3216; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%for.body> U: [0,9) S: [0,9) Exits: 8 LoopDispositions: { %for.body: Computable }17; CHECK-NEXT: %arrayidx = getelementptr inbounds i32, ptr %x, i64 %idxprom18; CHECK-NEXT: --> {%x,+,4}<nuw><%for.body> U: full-set S: full-set Exits: (32 + %x) LoopDispositions: { %for.body: Computable }19; CHECK-NEXT: %0 = load i32, ptr %arrayidx, align 420; CHECK-NEXT: --> %0 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %for.body: Variant }21; CHECK-NEXT: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)22; CHECK-NEXT: --> %call U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %for.body: Variant }23; CHECK-NEXT: %inc = add nuw nsw i64 %i.03, 124; CHECK-NEXT: --> {2,+,1}<nuw><nsw><%for.body> U: [2,11) S: [2,11) Exits: 10 LoopDispositions: { %for.body: Computable }25; CHECK-NEXT: Determining loop execution counts for: @test_loop26; CHECK-NEXT: Loop %for.body: backedge-taken count is i64 827; CHECK-NEXT: Loop %for.body: constant max backedge-taken count is i64 828; CHECK-NEXT: Loop %for.body: symbolic max backedge-taken count is i64 829; CHECK-NEXT: Loop %for.body: Trip multiple is 930;31entry:32 br label %for.body33 34for.cond.cleanup: ; preds = %for.body35 ret i32 036 37for.body: ; preds = %entry, %for.body38 %i.03 = phi i64 [ 1, %entry ], [ %inc, %for.body ]39 %conv = shl nuw nsw i64 %i.03, 3240 %sext = add nsw i64 %conv, -429496729641 %idxprom = ashr exact i64 %sext, 3242 %arrayidx = getelementptr inbounds i32, ptr %x, i64 %idxprom43 %0 = load i32, ptr %arrayidx, align 444 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)45 %inc = add nuw nsw i64 %i.03, 146 %exitcond.not = icmp eq i64 %inc, 1047 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body48}49 50declare noundef i32 @printf(ptr nocapture noundef readonly, ...)51