brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.2 KiB · 720b2ae Raw
127 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 42; RUN: opt -S -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-classify-expressions=0 < %s 2>&1 | FileCheck %s3 4define void @u_0(i8 %rhs) {5; E.g.: %rhs = 255, %start = 99, backedge taken 156 times6;7; CHECK-LABEL: 'u_0'8; CHECK-NEXT:  Determining loop execution counts for: @u_09; CHECK-NEXT:  Loop %loop: backedge-taken count is (-100 + (-1 * %rhs) + ((100 + %rhs) umax %rhs))10; CHECK-NEXT:  Loop %loop: constant max backedge-taken count is i8 -100, actual taken count either this or zero.11; CHECK-NEXT:  Loop %loop: symbolic max backedge-taken count is (-100 + (-1 * %rhs) + ((100 + %rhs) umax %rhs)), actual taken count either this or zero.12; CHECK-NEXT:  Loop %loop: Trip multiple is 113;14entry:15  %start = add i8 %rhs, 10016  br label %loop17 18loop:19  %iv = phi i8 [ %start, %entry ], [ %iv.inc, %loop ]20  %iv.inc = add nuw i8 %iv, 1  ;; Note: this never unsigned-wraps21  %iv.cmp = icmp ult i8 %iv, %rhs22  br i1 %iv.cmp, label %loop, label %leave23 24 25leave:26  ret void27}28 29define void @u_1(i8 %start) {30;31; CHECK-LABEL: 'u_1'32; CHECK-NEXT:  Determining loop execution counts for: @u_133; CHECK-NEXT:  Loop %loop: backedge-taken count is ((-1 * %start) + ((-100 + %start) umax %start))34; CHECK-NEXT:  Loop %loop: constant max backedge-taken count is i8 -100, actual taken count either this or zero.35; CHECK-NEXT:  Loop %loop: symbolic max backedge-taken count is ((-1 * %start) + ((-100 + %start) umax %start)), actual taken count either this or zero.36; CHECK-NEXT:  Loop %loop: Trip multiple is 137;38entry:39; E.g.: %start = 99, %rhs = 255, backedge taken 156 times40  %rhs = add i8 %start, -10041  br label %loop42 43loop:44  %iv = phi i8 [ %start, %entry ], [ %iv.inc, %loop ]45  %iv.inc = add nuw i8 %iv, 1  ;; Note: this never unsigned-wraps46  %iv.cmp = icmp ult i8 %iv, %rhs47  br i1 %iv.cmp, label %loop, label %leave48 49 50leave:51  ret void52}53 54define void @s_0(i8 %rhs) {55;56; CHECK-LABEL: 's_0'57; CHECK-NEXT:  Determining loop execution counts for: @s_058; CHECK-NEXT:  Loop %loop: backedge-taken count is (-100 + (-1 * %rhs) + ((100 + %rhs) smax %rhs))59; CHECK-NEXT:  Loop %loop: constant max backedge-taken count is i8 -100, actual taken count either this or zero.60; CHECK-NEXT:  Loop %loop: symbolic max backedge-taken count is (-100 + (-1 * %rhs) + ((100 + %rhs) smax %rhs)), actual taken count either this or zero.61; CHECK-NEXT:  Loop %loop: Trip multiple is 162;63entry:64; E.g.: %rhs = 127, %start = -29, backedge taken 156 times65  %start = add i8 %rhs, 10066  br label %loop67 68loop:69  %iv = phi i8 [ %start, %entry ], [ %iv.inc, %loop ]70  %iv.inc = add nsw i8 %iv, 1  ;; Note: this never signed-wraps71  %iv.cmp = icmp slt i8 %iv, %rhs72  br i1 %iv.cmp, label %loop, label %leave73 74 75leave:76  ret void77}78 79define void @s_1(i8 %start) {80;81; CHECK-LABEL: 's_1'82; CHECK-NEXT:  Determining loop execution counts for: @s_183; CHECK-NEXT:  Loop %loop: backedge-taken count is ((-1 * %start) + ((-100 + %start) smax %start))84; CHECK-NEXT:  Loop %loop: constant max backedge-taken count is i8 -100, actual taken count either this or zero.85; CHECK-NEXT:  Loop %loop: symbolic max backedge-taken count is ((-1 * %start) + ((-100 + %start) smax %start)), actual taken count either this or zero.86; CHECK-NEXT:  Loop %loop: Trip multiple is 187;88entry:89; E.g.: start = -29, %rhs = 127, %backedge taken 156 times90  %rhs = add i8 %start, -10091  br label %loop92 93loop:94  %iv = phi i8 [ %start, %entry ], [ %iv.inc, %loop ]95  %iv.inc = add nsw i8 %iv, 196  %iv.cmp = icmp slt i8 %iv, %rhs97  br i1 %iv.cmp, label %loop, label %leave98 99 100leave:101  ret void102}103 104define void @s_2(i8 %start) {105;106; CHECK-LABEL: 's_2'107; CHECK-NEXT:  Determining loop execution counts for: @s_2108; CHECK-NEXT:  Loop %loop: backedge-taken count is ((-1 * ((-100 + %start) smin %start)) + %start)109; CHECK-NEXT:  Loop %loop: constant max backedge-taken count is i8 -1110; CHECK-NEXT:  Loop %loop: symbolic max backedge-taken count is ((-1 * ((-100 + %start) smin %start)) + %start)111; CHECK-NEXT:  Loop %loop: Trip multiple is 1112;113entry:114  %rhs = add i8 %start, -100115  br label %loop116 117loop:118  %iv = phi i8 [ %start, %entry ], [ %iv.inc, %loop ]119  %iv.inc = add nsw i8 %iv, -1120  %iv.cmp = icmp sgt i8 %iv, %rhs121  br i1 %iv.cmp, label %loop, label %leave122 123 124leave:125  ret void126}127