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 63
12 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (%N /u 4)
13 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (%N /u 4)
14 ; CHECK-NEXT: Predicates:
15 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
21 %iv = phi i8 [ 0, %entry ], [ %iv.next, %loop ]
22 %gep = getelementptr i8, ptr %ptr, i8 %iv
23 store i8 %iv, ptr %gep
24 %iv.next = add nuw nsw i8 %iv, 4
25 %ec = icmp ne i8 %iv, %N
26 br i1 %ec, label %loop, label %exit
32 define void @max_backedge_taken_count_by_wrapping1_nuw(i8 %N, ptr %ptr) {
33 ; CHECK-LABEL: 'max_backedge_taken_count_by_wrapping1_nuw'
34 ; CHECK-NEXT: Determining loop execution counts for: @max_backedge_taken_count_by_wrapping1_nuw
35 ; CHECK-NEXT: Loop %loop: backedge-taken count is (%N /u 4)
36 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 63
37 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is (%N /u 4)
38 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is (%N /u 4)
39 ; CHECK-NEXT: Predicates:
40 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
46 %iv = phi i8 [ 0, %entry ], [ %iv.next, %loop ]
47 %gep = getelementptr i8, ptr %ptr, i8 %iv
48 store i8 %iv, ptr %gep
49 %iv.next = add nuw i8 %iv, 4
50 %ec = icmp ne i8 %iv, %N
51 br i1 %ec, label %loop, label %exit
57 define void @max_backedge_taken_count_by_wrapping2_nsw_nuw(i8 %N, ptr %ptr) {
58 ; CHECK-LABEL: 'max_backedge_taken_count_by_wrapping2_nsw_nuw'
59 ; CHECK-NEXT: Determining loop execution counts for: @max_backedge_taken_count_by_wrapping2_nsw_nuw
60 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-64 + %N) /u 4)
61 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 63
62 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-64 + %N) /u 4)
63 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-64 + %N) /u 4)
64 ; CHECK-NEXT: Predicates:
65 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
71 %iv = phi i8 [ 64, %entry ], [ %iv.next, %loop ]
72 %gep = getelementptr i8, ptr %ptr, i8 %iv
73 store i8 %iv, ptr %gep
74 %iv.next = add nuw nsw i8 %iv, 4
75 %ec = icmp ne i8 %iv, %N
76 br i1 %ec, label %loop, label %exit
82 define void @max_backedge_taken_count_by_wrapping2_nuw(i8 %N, ptr %ptr) {
83 ; CHECK-LABEL: 'max_backedge_taken_count_by_wrapping2_nuw'
84 ; CHECK-NEXT: Determining loop execution counts for: @max_backedge_taken_count_by_wrapping2_nuw
85 ; CHECK-NEXT: Loop %loop: backedge-taken count is ((-64 + %N) /u 4)
86 ; CHECK-NEXT: Loop %loop: constant max backedge-taken count is 63
87 ; CHECK-NEXT: Loop %loop: symbolic max backedge-taken count is ((-64 + %N) /u 4)
88 ; CHECK-NEXT: Loop %loop: Predicated backedge-taken count is ((-64 + %N) /u 4)
89 ; CHECK-NEXT: Predicates:
90 ; CHECK-NEXT: Loop %loop: Trip multiple is 1
96 %iv = phi i8 [ 64, %entry ], [ %iv.next, %loop ]
97 %gep = getelementptr i8, ptr %ptr, i8 %iv
98 store i8 %iv, ptr %gep
99 %iv.next = add nuw i8 %iv, 4
100 %ec = icmp ne i8 %iv, %N
101 br i1 %ec, label %loop, label %exit