1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -disable-output "-passes=print<scalar-evolution>" -scalar-evolution-max-iterations=0 -scalar-evolution-classify-expressions=0 2>&1 | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 define void @max_backedge_taken_count_by_wrapping1_nsw_nuw(i8 %N, ptr %ptr) {
8 ; CHECK-LABEL: 'max_backedge_taken_count_by_wrapping1_nsw_nuw'
9 ; CHECK-NEXT: Determining loop execution counts for: @max_backedge_taken_count_by_wrapping1_nsw_nuw
10 ; CHECK-NEXT: Loop %loop: backedge-taken count is (%N /u 4)
11 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i8 63
12 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (%N /u 4)
13 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
19 %iv = phi i8 [ 0, %entry ], [ %iv.next, %loop ]
20 %gep = getelementptr i8, ptr %ptr, i8 %iv
21 store i8 %iv, ptr %gep
22 %iv.next = add nuw nsw i8 %iv, 4
23 %ec = icmp ne i8 %iv, %N
24 br i1 %ec, label %loop, label %exit
30 define void @max_backedge_taken_count_by_wrapping1_nuw(i8 %N, ptr %ptr) {
31 ; CHECK-LABEL: 'max_backedge_taken_count_by_wrapping1_nuw'
32 ; CHECK-NEXT: Determining loop execution counts for: @max_backedge_taken_count_by_wrapping1_nuw
33 ; CHECK-NEXT: Loop %loop: backedge-taken count is (%N /u 4)
34 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i8 63
35 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (%N /u 4)
36 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
42 %iv = phi i8 [ 0, %entry ], [ %iv.next, %loop ]
43 %gep = getelementptr i8, ptr %ptr, i8 %iv
44 store i8 %iv, ptr %gep
45 %iv.next = add nuw i8 %iv, 4
46 %ec = icmp ne i8 %iv, %N
47 br i1 %ec, label %loop, label %exit
53 define void @max_backedge_taken_count_by_wrapping2_nsw_nuw(i8 %N, ptr %ptr) {
54 ; CHECK-LABEL: 'max_backedge_taken_count_by_wrapping2_nsw_nuw'
55 ; CHECK-NEXT: Determining loop execution counts for: @max_backedge_taken_count_by_wrapping2_nsw_nuw
56 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-64 + %N) /u 4)
57 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i8 63
58 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-64 + %N) /u 4)
59 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
65 %iv = phi i8 [ 64, %entry ], [ %iv.next, %loop ]
66 %gep = getelementptr i8, ptr %ptr, i8 %iv
67 store i8 %iv, ptr %gep
68 %iv.next = add nuw nsw i8 %iv, 4
69 %ec = icmp ne i8 %iv, %N
70 br i1 %ec, label %loop, label %exit
76 define void @max_backedge_taken_count_by_wrapping2_nuw(i8 %N, ptr %ptr) {
77 ; CHECK-LABEL: 'max_backedge_taken_count_by_wrapping2_nuw'
78 ; CHECK-NEXT: Determining loop execution counts for: @max_backedge_taken_count_by_wrapping2_nuw
79 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-64 + %N) /u 4)
80 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is i8 63
81 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-64 + %N) /u 4)
82 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
88 %iv = phi i8 [ 64, %entry ], [ %iv.next, %loop ]
89 %gep = getelementptr i8, ptr %ptr, i8 %iv
90 store i8 %iv, ptr %gep
91 %iv.next = add nuw i8 %iv, 4
92 %ec = icmp ne i8 %iv, %N
93 br i1 %ec, label %loop, label %exit