no-wrap-unknown-becount.ll
4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s
declare void @llvm.experimental.guard(i1, ...)
declare void @llvm.assume(i1)
define void @s_0(i32 %n, i1* %cond) {
; CHECK-LABEL: Classifying expressions for: @s_0
entry:
br label %loop
loop:
%iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
%iv.inc = add i32 %iv, 1
%iv.sext = sext i32 %iv to i64
; CHECK: %iv.sext = sext i32 %iv to i64
; CHECK-NEXT: --> {0,+,1}<nuw><nsw><%loop>
%cmp = icmp slt i32 %iv, %n
call void(i1, ...) @llvm.experimental.guard(i1 %cmp) [ "deopt"() ]
%c = load volatile i1, i1* %cond
br i1 %c, label %loop, label %leave
leave:
ret void
}
define void @s_1(i1* %cond) {
; CHECK-LABEL: Classifying expressions for: @s_1
entry:
br label %loop
loop:
%iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
%iv.inc = add i32 %iv, 3
%iv.sext = sext i32 %iv to i64
; CHECK: %iv.sext = sext i32 %iv to i64
; CHECK-NEXT: --> {0,+,3}<nuw><nsw><%loop>
%cmp = icmp slt i32 %iv, 10000
call void(i1, ...) @llvm.experimental.guard(i1 %cmp) [ "deopt"() ]
%c = load volatile i1, i1* %cond
br i1 %c, label %loop, label %leave
leave:
ret void
}
define void @s_2(i1* %cond) {
; CHECK-LABEL: Classifying expressions for: @s_2
entry:
br label %loop
loop:
%iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
%iv.inc = add i32 %iv, 3
%iv.sext = sext i32 %iv to i64
%cmp = icmp slt i32 %iv, 10000
; CHECK: %iv.sext = sext i32 %iv to i64
; CHECK-NEXT: --> {0,+,3}<nuw><nsw><%loop>
call void @llvm.assume(i1 %cmp)
%c = load volatile i1, i1* %cond
br i1 %c, label %loop, label %leave
leave:
ret void
}
define void @s_3(i32 %start, i1* %cond) {
; CHECK-LABEL: Classifying expressions for: @s_3
entry:
br label %loop
loop:
%iv = phi i32 [ %start, %entry ], [ %iv.inc, %be ]
%cmp = icmp slt i32 %iv, 10000
br i1 %cmp, label %be, label %leave
be:
%iv.inc = add i32 %iv, 3
%iv.inc.sext = sext i32 %iv.inc to i64
; CHECK: %iv.inc.sext = sext i32 %iv.inc to i64
; CHECK-NEXT: --> {(sext i32 (3 + %start) to i64),+,3}<nsw><%loop>
%c = load volatile i1, i1* %cond
br i1 %c, label %loop, label %leave
leave:
ret void
}
define void @s_4(i32 %start, i1* %cond) {
; CHECK-LABEL: Classifying expressions for: @s_4
entry:
br label %loop
loop:
%iv = phi i32 [ %start, %entry ], [ %iv.inc, %be ]
%cmp = icmp sgt i32 %iv, -1000
br i1 %cmp, label %be, label %leave
be:
%iv.inc = add i32 %iv, -3
%iv.inc.sext = sext i32 %iv.inc to i64
; CHECK: %iv.inc.sext = sext i32 %iv.inc to i64
; CHECK-NEXT: --> {(sext i32 (-3 + %start) to i64),+,-3}<nsw><%loop>
%c = load volatile i1, i1* %cond
br i1 %c, label %loop, label %leave
leave:
ret void
}
define void @u_0(i32 %n, i1* %cond) {
; CHECK-LABEL: Classifying expressions for: @u_0
entry:
br label %loop
loop:
%iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
%iv.inc = add i32 %iv, 1
%iv.zext = zext i32 %iv to i64
; CHECK: %iv.zext = zext i32 %iv to i64
; CHECK-NEXT: --> {0,+,1}<nuw><%loop>
%cmp = icmp ult i32 %iv, %n
call void(i1, ...) @llvm.experimental.guard(i1 %cmp) [ "deopt"() ]
%c = load volatile i1, i1* %cond
br i1 %c, label %loop, label %leave
leave:
ret void
}
define void @u_1(i1* %cond) {
; CHECK-LABEL: Classifying expressions for: @u_1
entry:
br label %loop
loop:
%iv = phi i32 [ 0, %entry ], [ %iv.inc, %loop ]
%iv.inc = add i32 %iv, 3
%iv.zext = zext i32 %iv to i64
; CHECK: %iv.zext = zext i32 %iv to i64
; CHECK-NEXT: --> {0,+,3}<nuw><%loop>
%cmp = icmp ult i32 %iv, 10000
call void(i1, ...) @llvm.experimental.guard(i1 %cmp) [ "deopt"() ]
%c = load volatile i1, i1* %cond
br i1 %c, label %loop, label %leave
leave:
ret void
}
define void @u_2(i1* %cond) {
; CHECK-LABEL: Classifying expressions for: @u_2
entry:
br label %loop
loop:
%iv = phi i32 [ 30000, %entry ], [ %iv.inc, %loop ]
%iv.inc = add i32 %iv, -2
%iv.zext = zext i32 %iv to i64
%cmp = icmp ugt i32 %iv.inc, -10000
; CHECK: %iv.zext = zext i32 %iv to i64
; CHECK-NEXT: --> {30000,+,-2}<nw><%loop>
call void @llvm.assume(i1 %cmp)
%c = load volatile i1, i1* %cond
br i1 %c, label %loop, label %leave
leave:
ret void
}
define void @u_3(i32 %start, i1* %cond) {
; CHECK-LABEL: Classifying expressions for: @u_3
entry:
br label %loop
loop:
%iv = phi i32 [ %start, %entry ], [ %iv.inc, %be ]
%cmp = icmp ult i32 %iv, 10000
br i1 %cmp, label %be, label %leave
be:
%iv.inc = add i32 %iv, 3
%iv.inc.zext = zext i32 %iv.inc to i64
; CHECK: %iv.inc.zext = zext i32 %iv.inc to i64
; CHECK-NEXT: --> {(zext i32 (3 + %start) to i64),+,3}<nuw><%loop>
%c = load volatile i1, i1* %cond
br i1 %c, label %loop, label %leave
leave:
ret void
}