1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s --data-layout="e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -S -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck --check-prefixes=ALL,X64 %s
3 ; RUN: opt < %s --data-layout="e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128" -S -disable-output "-passes=print<scalar-evolution>" 2>&1 | FileCheck --check-prefixes=ALL,X32 %s
5 ; While we can't treat inttoptr/ptrtoint casts as fully transparent,
6 ; for ptrtoint cast, instead of modelling it as fully opaque (unknown),
7 ; we can at least model it as zext/trunc/self of an unknown,
8 ; iff it it's argument would be modelled as unknown anyways.
10 declare void @useptr(ptr)
12 ; Simple ptrtoint of an argument, with casts to potentially different bit widths.
13 define void @ptrtoint(ptr %in, ptr %out0, ptr %out1, ptr %out2, ptr %out3) {
14 ; X64-LABEL: 'ptrtoint'
15 ; X64-NEXT: Classifying expressions for: @ptrtoint
16 ; X64-NEXT: %p0 = ptrtoint ptr %in to i64
17 ; X64-NEXT: --> (ptrtoint ptr %in to i64) U: full-set S: full-set
18 ; X64-NEXT: %p1 = ptrtoint ptr %in to i32
19 ; X64-NEXT: --> (trunc i64 (ptrtoint ptr %in to i64) to i32) U: full-set S: full-set
20 ; X64-NEXT: %p2 = ptrtoint ptr %in to i16
21 ; X64-NEXT: --> (trunc i64 (ptrtoint ptr %in to i64) to i16) U: full-set S: full-set
22 ; X64-NEXT: %p3 = ptrtoint ptr %in to i128
23 ; X64-NEXT: --> (zext i64 (ptrtoint ptr %in to i64) to i128) U: [0,18446744073709551616) S: [0,18446744073709551616)
24 ; X64-NEXT: Determining loop execution counts for: @ptrtoint
26 ; X32-LABEL: 'ptrtoint'
27 ; X32-NEXT: Classifying expressions for: @ptrtoint
28 ; X32-NEXT: %p0 = ptrtoint ptr %in to i64
29 ; X32-NEXT: --> (zext i32 (ptrtoint ptr %in to i32) to i64) U: [0,4294967296) S: [0,4294967296)
30 ; X32-NEXT: %p1 = ptrtoint ptr %in to i32
31 ; X32-NEXT: --> (ptrtoint ptr %in to i32) U: full-set S: full-set
32 ; X32-NEXT: %p2 = ptrtoint ptr %in to i16
33 ; X32-NEXT: --> (trunc i32 (ptrtoint ptr %in to i32) to i16) U: full-set S: full-set
34 ; X32-NEXT: %p3 = ptrtoint ptr %in to i128
35 ; X32-NEXT: --> (zext i32 (ptrtoint ptr %in to i32) to i128) U: [0,4294967296) S: [0,4294967296)
36 ; X32-NEXT: Determining loop execution counts for: @ptrtoint
38 %p0 = ptrtoint ptr %in to i64
39 %p1 = ptrtoint ptr %in to i32
40 %p2 = ptrtoint ptr %in to i16
41 %p3 = ptrtoint ptr %in to i128
42 store i64 %p0, ptr %out0
43 store i32 %p1, ptr %out1
44 store i16 %p2, ptr %out2
45 store i128 %p3, ptr %out3
49 ; Same, but from non-zero/non-default address space.
50 define void @ptrtoint_as1(ptr addrspace(1) %in, ptr %out0, ptr %out1, ptr %out2, ptr %out3) {
51 ; X64-LABEL: 'ptrtoint_as1'
52 ; X64-NEXT: Classifying expressions for: @ptrtoint_as1
53 ; X64-NEXT: %p0 = ptrtoint ptr addrspace(1) %in to i64
54 ; X64-NEXT: --> (ptrtoint ptr addrspace(1) %in to i64) U: full-set S: full-set
55 ; X64-NEXT: %p1 = ptrtoint ptr addrspace(1) %in to i32
56 ; X64-NEXT: --> (trunc i64 (ptrtoint ptr addrspace(1) %in to i64) to i32) U: full-set S: full-set
57 ; X64-NEXT: %p2 = ptrtoint ptr addrspace(1) %in to i16
58 ; X64-NEXT: --> (trunc i64 (ptrtoint ptr addrspace(1) %in to i64) to i16) U: full-set S: full-set
59 ; X64-NEXT: %p3 = ptrtoint ptr addrspace(1) %in to i128
60 ; X64-NEXT: --> (zext i64 (ptrtoint ptr addrspace(1) %in to i64) to i128) U: [0,18446744073709551616) S: [0,18446744073709551616)
61 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_as1
63 ; X32-LABEL: 'ptrtoint_as1'
64 ; X32-NEXT: Classifying expressions for: @ptrtoint_as1
65 ; X32-NEXT: %p0 = ptrtoint ptr addrspace(1) %in to i64
66 ; X32-NEXT: --> (zext i32 (ptrtoint ptr addrspace(1) %in to i32) to i64) U: [0,4294967296) S: [0,4294967296)
67 ; X32-NEXT: %p1 = ptrtoint ptr addrspace(1) %in to i32
68 ; X32-NEXT: --> (ptrtoint ptr addrspace(1) %in to i32) U: full-set S: full-set
69 ; X32-NEXT: %p2 = ptrtoint ptr addrspace(1) %in to i16
70 ; X32-NEXT: --> (trunc i32 (ptrtoint ptr addrspace(1) %in to i32) to i16) U: full-set S: full-set
71 ; X32-NEXT: %p3 = ptrtoint ptr addrspace(1) %in to i128
72 ; X32-NEXT: --> (zext i32 (ptrtoint ptr addrspace(1) %in to i32) to i128) U: [0,4294967296) S: [0,4294967296)
73 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_as1
75 %p0 = ptrtoint ptr addrspace(1) %in to i64
76 %p1 = ptrtoint ptr addrspace(1) %in to i32
77 %p2 = ptrtoint ptr addrspace(1) %in to i16
78 %p3 = ptrtoint ptr addrspace(1) %in to i128
79 store i64 %p0, ptr %out0
80 store i32 %p1, ptr %out1
81 store i16 %p2, ptr %out2
82 store i128 %p3, ptr %out3
86 ; Likewise, ptrtoint of a bitcast is fine, we simply skip it.
87 define void @ptrtoint_of_bitcast(ptr %in, ptr %out0) {
88 ; X64-LABEL: 'ptrtoint_of_bitcast'
89 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_bitcast
90 ; X64-NEXT: %in_casted = bitcast ptr %in to ptr
91 ; X64-NEXT: --> %in U: full-set S: full-set
92 ; X64-NEXT: %p0 = ptrtoint ptr %in_casted to i64
93 ; X64-NEXT: --> (ptrtoint ptr %in to i64) U: full-set S: full-set
94 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_bitcast
96 ; X32-LABEL: 'ptrtoint_of_bitcast'
97 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_bitcast
98 ; X32-NEXT: %in_casted = bitcast ptr %in to ptr
99 ; X32-NEXT: --> %in U: full-set S: full-set
100 ; X32-NEXT: %p0 = ptrtoint ptr %in_casted to i64
101 ; X32-NEXT: --> (zext i32 (ptrtoint ptr %in to i32) to i64) U: [0,4294967296) S: [0,4294967296)
102 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_bitcast
104 %in_casted = bitcast ptr %in to ptr
105 %p0 = ptrtoint ptr %in_casted to i64
106 store i64 %p0, ptr %out0
110 ; addrspacecast is fine too, but We don't model addrspacecast, so we stop there.
111 define void @ptrtoint_of_addrspacecast(ptr %in, ptr %out0) {
112 ; X64-LABEL: 'ptrtoint_of_addrspacecast'
113 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_addrspacecast
114 ; X64-NEXT: %in_casted = addrspacecast ptr %in to ptr addrspace(1)
115 ; X64-NEXT: --> %in_casted U: full-set S: full-set
116 ; X64-NEXT: %p0 = ptrtoint ptr addrspace(1) %in_casted to i64
117 ; X64-NEXT: --> (ptrtoint ptr addrspace(1) %in_casted to i64) U: full-set S: full-set
118 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_addrspacecast
120 ; X32-LABEL: 'ptrtoint_of_addrspacecast'
121 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_addrspacecast
122 ; X32-NEXT: %in_casted = addrspacecast ptr %in to ptr addrspace(1)
123 ; X32-NEXT: --> %in_casted U: full-set S: full-set
124 ; X32-NEXT: %p0 = ptrtoint ptr addrspace(1) %in_casted to i64
125 ; X32-NEXT: --> (zext i32 (ptrtoint ptr addrspace(1) %in_casted to i32) to i64) U: [0,4294967296) S: [0,4294967296)
126 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_addrspacecast
128 %in_casted = addrspacecast ptr %in to ptr addrspace(1)
129 %p0 = ptrtoint ptr addrspace(1) %in_casted to i64
130 store i64 %p0, ptr %out0
134 ; inttoptr is fine too, but we don't (and can't) model inttoptr, so we stop there.
135 define void @ptrtoint_of_inttoptr(i64 %in, ptr %out0) {
136 ; X64-LABEL: 'ptrtoint_of_inttoptr'
137 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_inttoptr
138 ; X64-NEXT: %in_casted = inttoptr i64 %in to ptr
139 ; X64-NEXT: --> %in_casted U: full-set S: full-set
140 ; X64-NEXT: %p0 = ptrtoint ptr %in_casted to i64
141 ; X64-NEXT: --> (ptrtoint ptr %in_casted to i64) U: full-set S: full-set
142 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_inttoptr
144 ; X32-LABEL: 'ptrtoint_of_inttoptr'
145 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_inttoptr
146 ; X32-NEXT: %in_casted = inttoptr i64 %in to ptr
147 ; X32-NEXT: --> %in_casted U: full-set S: full-set
148 ; X32-NEXT: %p0 = ptrtoint ptr %in_casted to i64
149 ; X32-NEXT: --> (zext i32 (ptrtoint ptr %in_casted to i32) to i64) U: [0,4294967296) S: [0,4294967296)
150 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_inttoptr
152 %in_casted = inttoptr i64 %in to ptr
153 %p0 = ptrtoint ptr %in_casted to i64
154 store i64 %p0, ptr %out0
158 ; A constant pointer is fine
159 define void @ptrtoint_of_nullptr(ptr %out0) {
160 ; ALL-LABEL: 'ptrtoint_of_nullptr'
161 ; ALL-NEXT: Classifying expressions for: @ptrtoint_of_nullptr
162 ; ALL-NEXT: %p0 = ptrtoint ptr null to i64
163 ; ALL-NEXT: --> 0 U: [0,1) S: [0,1)
164 ; ALL-NEXT: Determining loop execution counts for: @ptrtoint_of_nullptr
166 %p0 = ptrtoint ptr null to i64
167 store i64 %p0, ptr %out0
171 ; A constant inttoptr argument of an ptrtoint is still bad.
172 define void @ptrtoint_of_constantexpr_inttoptr(ptr %out0) {
173 ; X64-LABEL: 'ptrtoint_of_constantexpr_inttoptr'
174 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_constantexpr_inttoptr
175 ; X64-NEXT: %p0 = ptrtoint ptr inttoptr (i64 42 to ptr) to i64
176 ; X64-NEXT: --> (ptrtoint ptr inttoptr (i64 42 to ptr) to i64) U: [42,43) S: [42,43)
177 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_constantexpr_inttoptr
179 ; X32-LABEL: 'ptrtoint_of_constantexpr_inttoptr'
180 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_constantexpr_inttoptr
181 ; X32-NEXT: %p0 = ptrtoint ptr inttoptr (i64 42 to ptr) to i64
182 ; X32-NEXT: --> (zext i32 (ptrtoint ptr inttoptr (i64 42 to ptr) to i32) to i64) U: [42,43) S: [42,43)
183 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_constantexpr_inttoptr
185 %p0 = ptrtoint ptr inttoptr (i64 42 to ptr) to i64
186 store i64 %p0, ptr %out0
190 ; ptrtoint of GEP is fine.
191 define void @ptrtoint_of_gep(ptr %in, ptr %out0) {
192 ; X64-LABEL: 'ptrtoint_of_gep'
193 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_gep
194 ; X64-NEXT: %in_adj = getelementptr inbounds i8, ptr %in, i64 42
195 ; X64-NEXT: --> (42 + %in) U: full-set S: full-set
196 ; X64-NEXT: %p0 = ptrtoint ptr %in_adj to i64
197 ; X64-NEXT: --> (42 + (ptrtoint ptr %in to i64)) U: full-set S: full-set
198 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_gep
200 ; X32-LABEL: 'ptrtoint_of_gep'
201 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_gep
202 ; X32-NEXT: %in_adj = getelementptr inbounds i8, ptr %in, i64 42
203 ; X32-NEXT: --> (42 + %in) U: full-set S: full-set
204 ; X32-NEXT: %p0 = ptrtoint ptr %in_adj to i64
205 ; X32-NEXT: --> (zext i32 (42 + (ptrtoint ptr %in to i32)) to i64) U: [0,4294967296) S: [0,4294967296)
206 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_gep
208 %in_adj = getelementptr inbounds i8, ptr %in, i64 42
209 %p0 = ptrtoint ptr %in_adj to i64
210 store i64 %p0, ptr %out0
214 ; It seems, we can't get ptrtoint of mul/udiv, or at least it's hard to come up with a test case.
217 define void @ptrtoint_of_addrec(ptr %in, i32 %count) {
218 ; X64-LABEL: 'ptrtoint_of_addrec'
219 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_addrec
220 ; X64-NEXT: %i3 = zext i32 %count to i64
221 ; X64-NEXT: --> (zext i32 %count to i64) U: [0,4294967296) S: [0,4294967296)
222 ; X64-NEXT: %i6 = phi i64 [ 0, %entry ], [ %i9, %loop ]
223 ; X64-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: (-1 + (zext i32 %count to i64))<nsw> LoopDispositions: { %loop: Computable }
224 ; X64-NEXT: %i7 = getelementptr inbounds i32, ptr %in, i64 %i6
225 ; X64-NEXT: --> {%in,+,4}<%loop> U: full-set S: full-set Exits: (-4 + (4 * (zext i32 %count to i64))<nuw><nsw> + %in) LoopDispositions: { %loop: Computable }
226 ; X64-NEXT: %i8 = ptrtoint ptr %i7 to i64
227 ; X64-NEXT: --> {(ptrtoint ptr %in to i64),+,4}<%loop> U: full-set S: full-set Exits: (-4 + (4 * (zext i32 %count to i64))<nuw><nsw> + (ptrtoint ptr %in to i64)) LoopDispositions: { %loop: Computable }
228 ; X64-NEXT: %i9 = add nuw nsw i64 %i6, 1
229 ; X64-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (zext i32 %count to i64) LoopDispositions: { %loop: Computable }
230 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_addrec
231 ; X64-NEXT: Loop %loop: backedge-taken count is (-1 + (zext i32 %count to i64))<nsw>
232 ; X64-NEXT: Loop %loop: constant max backedge-taken count is -1
233 ; X64-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (zext i32 %count to i64))<nsw>
234 ; X64-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (zext i32 %count to i64))<nsw>
235 ; X64-NEXT: Predicates:
236 ; X64-NEXT: Loop %loop: Trip multiple is 1
238 ; X32-LABEL: 'ptrtoint_of_addrec'
239 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_addrec
240 ; X32-NEXT: %i3 = zext i32 %count to i64
241 ; X32-NEXT: --> (zext i32 %count to i64) U: [0,4294967296) S: [0,4294967296)
242 ; X32-NEXT: %i6 = phi i64 [ 0, %entry ], [ %i9, %loop ]
243 ; X32-NEXT: --> {0,+,1}<nuw><nsw><%loop> U: [0,-9223372036854775808) S: [0,-9223372036854775808) Exits: (-1 + (zext i32 %count to i64))<nsw> LoopDispositions: { %loop: Computable }
244 ; X32-NEXT: %i7 = getelementptr inbounds i32, ptr %in, i64 %i6
245 ; X32-NEXT: --> {%in,+,4}<%loop> U: full-set S: full-set Exits: (-4 + (4 * %count) + %in) LoopDispositions: { %loop: Computable }
246 ; X32-NEXT: %i8 = ptrtoint ptr %i7 to i64
247 ; X32-NEXT: --> (zext i32 {(ptrtoint ptr %in to i32),+,4}<%loop> to i64) U: [0,4294967296) S: [0,4294967296) Exits: (zext i32 (-4 + (4 * %count) + (ptrtoint ptr %in to i32)) to i64) LoopDispositions: { %loop: Computable }
248 ; X32-NEXT: %i9 = add nuw nsw i64 %i6, 1
249 ; X32-NEXT: --> {1,+,1}<nuw><%loop> U: [1,0) S: [1,0) Exits: (zext i32 %count to i64) LoopDispositions: { %loop: Computable }
250 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_addrec
251 ; X32-NEXT: Loop %loop: backedge-taken count is (-1 + (zext i32 %count to i64))<nsw>
252 ; X32-NEXT: Loop %loop: constant max backedge-taken count is -1
253 ; X32-NEXT: Loop %loop: symbolic max backedge-taken count is (-1 + (zext i32 %count to i64))<nsw>
254 ; X32-NEXT: Loop %loop: Predicated backedge-taken count is (-1 + (zext i32 %count to i64))<nsw>
255 ; X32-NEXT: Predicates:
256 ; X32-NEXT: Loop %loop: Trip multiple is 1
259 %i3 = zext i32 %count to i64
263 %i6 = phi i64 [ 0, %entry ], [ %i9, %loop ]
264 %i7 = getelementptr inbounds i32, ptr %in, i64 %i6
265 %i8 = ptrtoint ptr %i7 to i64
266 tail call void @use(i64 %i8)
267 %i9 = add nuw nsw i64 %i6, 1
268 %i10 = icmp eq i64 %i9, %i3
269 br i1 %i10, label %end, label %loop
274 declare void @use(i64)
277 define void @ptrtoint_of_umax(ptr %in0, ptr %in1, ptr %out0) {
278 ; X64-LABEL: 'ptrtoint_of_umax'
279 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_umax
280 ; X64-NEXT: %s = select i1 %c, ptr %in0, ptr %in1
281 ; X64-NEXT: --> (%in0 umax %in1) U: full-set S: full-set
282 ; X64-NEXT: %p0 = ptrtoint ptr %s to i64
283 ; X64-NEXT: --> ((ptrtoint ptr %in0 to i64) umax (ptrtoint ptr %in1 to i64)) U: full-set S: full-set
284 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_umax
286 ; X32-LABEL: 'ptrtoint_of_umax'
287 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_umax
288 ; X32-NEXT: %s = select i1 %c, ptr %in0, ptr %in1
289 ; X32-NEXT: --> (%in0 umax %in1) U: full-set S: full-set
290 ; X32-NEXT: %p0 = ptrtoint ptr %s to i64
291 ; X32-NEXT: --> ((zext i32 (ptrtoint ptr %in0 to i32) to i64) umax (zext i32 (ptrtoint ptr %in1 to i32) to i64)) U: [0,4294967296) S: [0,4294967296)
292 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_umax
294 %c = icmp uge ptr %in0, %in1
295 %s = select i1 %c, ptr %in0, ptr %in1
296 %p0 = ptrtoint ptr %s to i64
297 store i64 %p0, ptr %out0
301 define void @ptrtoint_of_smax(ptr %in0, ptr %in1, ptr %out0) {
302 ; X64-LABEL: 'ptrtoint_of_smax'
303 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_smax
304 ; X64-NEXT: %s = select i1 %c, ptr %in0, ptr %in1
305 ; X64-NEXT: --> (%in0 smax %in1) U: full-set S: full-set
306 ; X64-NEXT: %p0 = ptrtoint ptr %s to i64
307 ; X64-NEXT: --> ((ptrtoint ptr %in0 to i64) smax (ptrtoint ptr %in1 to i64)) U: full-set S: full-set
308 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_smax
310 ; X32-LABEL: 'ptrtoint_of_smax'
311 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_smax
312 ; X32-NEXT: %s = select i1 %c, ptr %in0, ptr %in1
313 ; X32-NEXT: --> (%in0 smax %in1) U: full-set S: full-set
314 ; X32-NEXT: %p0 = ptrtoint ptr %s to i64
315 ; X32-NEXT: --> (zext i32 ((ptrtoint ptr %in0 to i32) smax (ptrtoint ptr %in1 to i32)) to i64) U: [0,4294967296) S: [0,4294967296)
316 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_smax
318 %c = icmp sge ptr %in0, %in1
319 %s = select i1 %c, ptr %in0, ptr %in1
320 %p0 = ptrtoint ptr %s to i64
321 store i64 %p0, ptr %out0
325 define void @ptrtoint_of_umin(ptr %in0, ptr %in1, ptr %out0) {
326 ; X64-LABEL: 'ptrtoint_of_umin'
327 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_umin
328 ; X64-NEXT: %s = select i1 %c, ptr %in0, ptr %in1
329 ; X64-NEXT: --> (%in0 umin %in1) U: full-set S: full-set
330 ; X64-NEXT: %p0 = ptrtoint ptr %s to i64
331 ; X64-NEXT: --> ((ptrtoint ptr %in0 to i64) umin (ptrtoint ptr %in1 to i64)) U: full-set S: full-set
332 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_umin
334 ; X32-LABEL: 'ptrtoint_of_umin'
335 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_umin
336 ; X32-NEXT: %s = select i1 %c, ptr %in0, ptr %in1
337 ; X32-NEXT: --> (%in0 umin %in1) U: full-set S: full-set
338 ; X32-NEXT: %p0 = ptrtoint ptr %s to i64
339 ; X32-NEXT: --> ((zext i32 (ptrtoint ptr %in0 to i32) to i64) umin (zext i32 (ptrtoint ptr %in1 to i32) to i64)) U: [0,4294967296) S: [0,4294967296)
340 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_umin
342 %c = icmp ule ptr %in0, %in1
343 %s = select i1 %c, ptr %in0, ptr %in1
344 %p0 = ptrtoint ptr %s to i64
345 store i64 %p0, ptr %out0
349 define void @ptrtoint_of_smin(ptr %in0, ptr %in1, ptr %out0) {
350 ; X64-LABEL: 'ptrtoint_of_smin'
351 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_smin
352 ; X64-NEXT: %s = select i1 %c, ptr %in0, ptr %in1
353 ; X64-NEXT: --> (%in0 smin %in1) U: full-set S: full-set
354 ; X64-NEXT: %p0 = ptrtoint ptr %s to i64
355 ; X64-NEXT: --> ((ptrtoint ptr %in0 to i64) smin (ptrtoint ptr %in1 to i64)) U: full-set S: full-set
356 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_smin
358 ; X32-LABEL: 'ptrtoint_of_smin'
359 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_smin
360 ; X32-NEXT: %s = select i1 %c, ptr %in0, ptr %in1
361 ; X32-NEXT: --> (%in0 smin %in1) U: full-set S: full-set
362 ; X32-NEXT: %p0 = ptrtoint ptr %s to i64
363 ; X32-NEXT: --> (zext i32 ((ptrtoint ptr %in0 to i32) smin (ptrtoint ptr %in1 to i32)) to i64) U: [0,4294967296) S: [0,4294967296)
364 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_smin
366 %c = icmp sle ptr %in0, %in1
367 %s = select i1 %c, ptr %in0, ptr %in1
368 %p0 = ptrtoint ptr %s to i64
369 store i64 %p0, ptr %out0
373 ; void pr46786_c26_char(char* start, char *end, char *other) {
374 ; for (char* cur = start; cur != end; ++cur)
375 ; other[cur - start] += *cur;
377 define void @pr46786_c26_char(ptr %arg, ptr %arg1, ptr %arg2) {
378 ; X64-LABEL: 'pr46786_c26_char'
379 ; X64-NEXT: Classifying expressions for: @pr46786_c26_char
380 ; X64-NEXT: %i4 = ptrtoint ptr %arg to i64
381 ; X64-NEXT: --> (ptrtoint ptr %arg to i64) U: full-set S: full-set
382 ; X64-NEXT: %i7 = phi ptr [ %arg, %bb3 ], [ %i14, %bb6 ]
383 ; X64-NEXT: --> {%arg,+,1}<nuw><%bb6> U: full-set S: full-set Exits: (-1 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64) + %arg) LoopDispositions: { %bb6: Computable }
384 ; X64-NEXT: %i8 = load i8, ptr %i7, align 1
385 ; X64-NEXT: --> %i8 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
386 ; X64-NEXT: %i9 = ptrtoint ptr %i7 to i64
387 ; X64-NEXT: --> {(ptrtoint ptr %arg to i64),+,1}<nuw><%bb6> U: full-set S: full-set Exits: (-1 + (ptrtoint ptr %arg1 to i64)) LoopDispositions: { %bb6: Computable }
388 ; X64-NEXT: %i10 = sub i64 %i9, %i4
389 ; X64-NEXT: --> {0,+,1}<nuw><%bb6> U: full-set S: full-set Exits: (-1 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) LoopDispositions: { %bb6: Computable }
390 ; X64-NEXT: %i11 = getelementptr inbounds i8, ptr %arg2, i64 %i10
391 ; X64-NEXT: --> {%arg2,+,1}<nw><%bb6> U: full-set S: full-set Exits: (-1 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64) + %arg2) LoopDispositions: { %bb6: Computable }
392 ; X64-NEXT: %i12 = load i8, ptr %i11, align 1
393 ; X64-NEXT: --> %i12 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
394 ; X64-NEXT: %i13 = add i8 %i12, %i8
395 ; X64-NEXT: --> (%i12 + %i8) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
396 ; X64-NEXT: %i14 = getelementptr inbounds i8, ptr %i7, i64 1
397 ; X64-NEXT: --> {(1 + %arg),+,1}<nuw><%bb6> U: full-set S: full-set Exits: ((-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64) + %arg) LoopDispositions: { %bb6: Computable }
398 ; X64-NEXT: Determining loop execution counts for: @pr46786_c26_char
399 ; X64-NEXT: Loop %bb6: backedge-taken count is (-1 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64))
400 ; X64-NEXT: Loop %bb6: constant max backedge-taken count is -1
401 ; X64-NEXT: Loop %bb6: symbolic max backedge-taken count is (-1 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64))
402 ; X64-NEXT: Loop %bb6: Predicated backedge-taken count is (-1 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64))
403 ; X64-NEXT: Predicates:
404 ; X64-NEXT: Loop %bb6: Trip multiple is 1
406 ; X32-LABEL: 'pr46786_c26_char'
407 ; X32-NEXT: Classifying expressions for: @pr46786_c26_char
408 ; X32-NEXT: %i4 = ptrtoint ptr %arg to i64
409 ; X32-NEXT: --> (zext i32 (ptrtoint ptr %arg to i32) to i64) U: [0,4294967296) S: [0,4294967296)
410 ; X32-NEXT: %i7 = phi ptr [ %arg, %bb3 ], [ %i14, %bb6 ]
411 ; X32-NEXT: --> {%arg,+,1}<nuw><%bb6> U: full-set S: full-set Exits: (-1 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32) + %arg) LoopDispositions: { %bb6: Computable }
412 ; X32-NEXT: %i8 = load i8, ptr %i7, align 1
413 ; X32-NEXT: --> %i8 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
414 ; X32-NEXT: %i9 = ptrtoint ptr %i7 to i64
415 ; X32-NEXT: --> {(zext i32 (ptrtoint ptr %arg to i32) to i64),+,1}<nuw><%bb6> U: [0,8589934591) S: [0,8589934591) Exits: ((zext i32 (-1 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) to i64) + (zext i32 (ptrtoint ptr %arg to i32) to i64)) LoopDispositions: { %bb6: Computable }
416 ; X32-NEXT: %i10 = sub i64 %i9, %i4
417 ; X32-NEXT: --> {0,+,1}<nuw><%bb6> U: [0,4294967296) S: [0,4294967296) Exits: (zext i32 (-1 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) to i64) LoopDispositions: { %bb6: Computable }
418 ; X32-NEXT: %i11 = getelementptr inbounds i8, ptr %arg2, i64 %i10
419 ; X32-NEXT: --> {%arg2,+,1}<%bb6> U: full-set S: full-set Exits: (-1 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32) + %arg2) LoopDispositions: { %bb6: Computable }
420 ; X32-NEXT: %i12 = load i8, ptr %i11, align 1
421 ; X32-NEXT: --> %i12 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
422 ; X32-NEXT: %i13 = add i8 %i12, %i8
423 ; X32-NEXT: --> (%i12 + %i8) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
424 ; X32-NEXT: %i14 = getelementptr inbounds i8, ptr %i7, i64 1
425 ; X32-NEXT: --> {(1 + %arg),+,1}<nuw><%bb6> U: full-set S: full-set Exits: ((-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32) + %arg) LoopDispositions: { %bb6: Computable }
426 ; X32-NEXT: Determining loop execution counts for: @pr46786_c26_char
427 ; X32-NEXT: Loop %bb6: backedge-taken count is (-1 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32))
428 ; X32-NEXT: Loop %bb6: constant max backedge-taken count is -1
429 ; X32-NEXT: Loop %bb6: symbolic max backedge-taken count is (-1 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32))
430 ; X32-NEXT: Loop %bb6: Predicated backedge-taken count is (-1 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32))
431 ; X32-NEXT: Predicates:
432 ; X32-NEXT: Loop %bb6: Trip multiple is 1
434 %i = icmp eq ptr %arg, %arg1
435 br i1 %i, label %bb5, label %bb3
438 %i4 = ptrtoint ptr %arg to i64
442 %i7 = phi ptr [ %arg, %bb3 ], [ %i14, %bb6 ]
443 %i8 = load i8, ptr %i7
444 %i9 = ptrtoint ptr %i7 to i64
445 %i10 = sub i64 %i9, %i4
446 %i11 = getelementptr inbounds i8, ptr %arg2, i64 %i10
447 %i12 = load i8, ptr %i11
448 %i13 = add i8 %i12, %i8
449 store i8 %i13, ptr %i11
450 %i14 = getelementptr inbounds i8, ptr %i7, i64 1
451 %i15 = icmp eq ptr %i14, %arg1
452 br i1 %i15, label %bb5, label %bb6
458 ; void pr46786_c26_int(int* start, int *end, int *other) {
459 ; for (int* cur = start; cur != end; ++cur)
460 ; other[cur - start] += *cur;
463 ; FIXME: 4 * (%i10 EXACT/s 4) is just %i10
464 define void @pr46786_c26_int(ptr %arg, ptr %arg1, ptr %arg2) {
465 ; X64-LABEL: 'pr46786_c26_int'
466 ; X64-NEXT: Classifying expressions for: @pr46786_c26_int
467 ; X64-NEXT: %i4 = ptrtoint ptr %arg to i64
468 ; X64-NEXT: --> (ptrtoint ptr %arg to i64) U: full-set S: full-set
469 ; X64-NEXT: %i7 = phi ptr [ %arg, %bb3 ], [ %i15, %bb6 ]
470 ; X64-NEXT: --> {%arg,+,4}<nuw><%bb6> U: full-set S: full-set Exits: ((4 * ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4))<nuw> + %arg) LoopDispositions: { %bb6: Computable }
471 ; X64-NEXT: %i8 = load i32, ptr %i7, align 4
472 ; X64-NEXT: --> %i8 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
473 ; X64-NEXT: %i9 = ptrtoint ptr %i7 to i64
474 ; X64-NEXT: --> {(ptrtoint ptr %arg to i64),+,4}<nuw><%bb6> U: full-set S: full-set Exits: ((4 * ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4))<nuw> + (ptrtoint ptr %arg to i64)) LoopDispositions: { %bb6: Computable }
475 ; X64-NEXT: %i10 = sub i64 %i9, %i4
476 ; X64-NEXT: --> {0,+,4}<nuw><%bb6> U: [0,-3) S: [-9223372036854775808,9223372036854775805) Exits: (4 * ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4))<nuw> LoopDispositions: { %bb6: Computable }
477 ; X64-NEXT: %i11 = ashr exact i64 %i10, 2
478 ; X64-NEXT: --> %i11 U: [-2305843009213693952,2305843009213693952) S: [-2305843009213693952,2305843009213693952) Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
479 ; X64-NEXT: %i12 = getelementptr inbounds i32, ptr %arg2, i64 %i11
480 ; X64-NEXT: --> ((4 * %i11)<nsw> + %arg2) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
481 ; X64-NEXT: %i13 = load i32, ptr %i12, align 4
482 ; X64-NEXT: --> %i13 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
483 ; X64-NEXT: %i14 = add nsw i32 %i13, %i8
484 ; X64-NEXT: --> (%i13 + %i8) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
485 ; X64-NEXT: %i15 = getelementptr inbounds i32, ptr %i7, i64 1
486 ; X64-NEXT: --> {(4 + %arg),+,4}<nuw><%bb6> U: full-set S: full-set Exits: (4 + (4 * ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4))<nuw> + %arg) LoopDispositions: { %bb6: Computable }
487 ; X64-NEXT: Determining loop execution counts for: @pr46786_c26_int
488 ; X64-NEXT: Loop %bb6: backedge-taken count is ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4)
489 ; X64-NEXT: Loop %bb6: constant max backedge-taken count is 4611686018427387903
490 ; X64-NEXT: Loop %bb6: symbolic max backedge-taken count is ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4)
491 ; X64-NEXT: Loop %bb6: Predicated backedge-taken count is ((-4 + (-1 * (ptrtoint ptr %arg to i64)) + (ptrtoint ptr %arg1 to i64)) /u 4)
492 ; X64-NEXT: Predicates:
493 ; X64-NEXT: Loop %bb6: Trip multiple is 1
495 ; X32-LABEL: 'pr46786_c26_int'
496 ; X32-NEXT: Classifying expressions for: @pr46786_c26_int
497 ; X32-NEXT: %i4 = ptrtoint ptr %arg to i64
498 ; X32-NEXT: --> (zext i32 (ptrtoint ptr %arg to i32) to i64) U: [0,4294967296) S: [0,4294967296)
499 ; X32-NEXT: %i7 = phi ptr [ %arg, %bb3 ], [ %i15, %bb6 ]
500 ; X32-NEXT: --> {%arg,+,4}<nuw><%bb6> U: full-set S: full-set Exits: ((4 * ((-4 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) /u 4))<nuw> + %arg) LoopDispositions: { %bb6: Computable }
501 ; X32-NEXT: %i8 = load i32, ptr %i7, align 4
502 ; X32-NEXT: --> %i8 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
503 ; X32-NEXT: %i9 = ptrtoint ptr %i7 to i64
504 ; X32-NEXT: --> {(zext i32 (ptrtoint ptr %arg to i32) to i64),+,4}<nuw><%bb6> U: [0,8589934588) S: [0,8589934588) Exits: ((zext i32 (ptrtoint ptr %arg to i32) to i64) + (4 * ((zext i32 (-4 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) to i64) /u 4))<nuw><nsw>) LoopDispositions: { %bb6: Computable }
505 ; X32-NEXT: %i10 = sub i64 %i9, %i4
506 ; X32-NEXT: --> {0,+,4}<nuw><%bb6> U: [0,4294967293) S: [0,4294967293) Exits: (4 * ((zext i32 (-4 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) to i64) /u 4))<nuw><nsw> LoopDispositions: { %bb6: Computable }
507 ; X32-NEXT: %i11 = ashr exact i64 %i10, 2
508 ; X32-NEXT: --> %i11 U: [-2147483648,2147483648) S: [-2147483648,2147483648) Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
509 ; X32-NEXT: %i12 = getelementptr inbounds i32, ptr %arg2, i64 %i11
510 ; X32-NEXT: --> ((4 * (trunc i64 %i11 to i32))<nsw> + %arg2) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
511 ; X32-NEXT: %i13 = load i32, ptr %i12, align 4
512 ; X32-NEXT: --> %i13 U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
513 ; X32-NEXT: %i14 = add nsw i32 %i13, %i8
514 ; X32-NEXT: --> (%i13 + %i8) U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb6: Variant }
515 ; X32-NEXT: %i15 = getelementptr inbounds i32, ptr %i7, i64 1
516 ; X32-NEXT: --> {(4 + %arg),+,4}<nuw><%bb6> U: full-set S: full-set Exits: (4 + (4 * ((-4 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) /u 4))<nuw> + %arg) LoopDispositions: { %bb6: Computable }
517 ; X32-NEXT: Determining loop execution counts for: @pr46786_c26_int
518 ; X32-NEXT: Loop %bb6: backedge-taken count is ((-4 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) /u 4)
519 ; X32-NEXT: Loop %bb6: constant max backedge-taken count is 1073741823
520 ; X32-NEXT: Loop %bb6: symbolic max backedge-taken count is ((-4 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) /u 4)
521 ; X32-NEXT: Loop %bb6: Predicated backedge-taken count is ((-4 + (-1 * (ptrtoint ptr %arg to i32)) + (ptrtoint ptr %arg1 to i32)) /u 4)
522 ; X32-NEXT: Predicates:
523 ; X32-NEXT: Loop %bb6: Trip multiple is 1
525 %i = icmp eq ptr %arg, %arg1
526 br i1 %i, label %bb5, label %bb3
529 %i4 = ptrtoint ptr %arg to i64
533 %i7 = phi ptr [ %arg, %bb3 ], [ %i15, %bb6 ]
534 %i8 = load i32, ptr %i7
535 %i9 = ptrtoint ptr %i7 to i64
536 %i10 = sub i64 %i9, %i4
537 %i11 = ashr exact i64 %i10, 2
538 %i12 = getelementptr inbounds i32, ptr %arg2, i64 %i11
539 %i13 = load i32, ptr %i12
540 %i14 = add nsw i32 %i13, %i8
541 store i32 %i14, ptr %i12
542 %i15 = getelementptr inbounds i32, ptr %i7, i64 1
543 %i16 = icmp eq ptr %i15, %arg1
544 br i1 %i16, label %bb5, label %bb6
550 ; During SCEV rewrites, we could end up calling `ScalarEvolution::getPtrToIntExpr()`
551 ; on an integer. Make sure we handle that case gracefully.
552 define void @ptrtoint_of_integer(ptr %arg, i64 %arg1, i1 %arg2) local_unnamed_addr {
553 ; X64-LABEL: 'ptrtoint_of_integer'
554 ; X64-NEXT: Classifying expressions for: @ptrtoint_of_integer
555 ; X64-NEXT: %i4 = ptrtoint ptr %arg to i64
556 ; X64-NEXT: --> (ptrtoint ptr %arg to i64) U: full-set S: full-set
557 ; X64-NEXT: %i6 = sub i64 %i4, %arg1
558 ; X64-NEXT: --> ((-1 * %arg1) + (ptrtoint ptr %arg to i64)) U: full-set S: full-set
559 ; X64-NEXT: %i9 = phi i64 [ 1, %bb7 ], [ %i11, %bb10 ]
560 ; X64-NEXT: --> {1,+,1}<nuw><%bb8> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %bb8: Computable }
561 ; X64-NEXT: %i11 = add nuw i64 %i9, 1
562 ; X64-NEXT: --> {2,+,1}<nw><%bb8> U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb8: Computable }
563 ; X64-NEXT: Determining loop execution counts for: @ptrtoint_of_integer
564 ; X64-NEXT: Loop %bb8: <multiple exits> Unpredictable backedge-taken count.
565 ; X64-NEXT: exit count for bb8: ***COULDNOTCOMPUTE***
566 ; X64-NEXT: exit count for bb10: (-2 + (-1 * %arg1) + (ptrtoint ptr %arg to i64))
567 ; X64-NEXT: Loop %bb8: constant max backedge-taken count is -1
568 ; X64-NEXT: Loop %bb8: symbolic max backedge-taken count is (-2 + (-1 * %arg1) + (ptrtoint ptr %arg to i64))
569 ; X64-NEXT: symbolic max exit count for bb8: ***COULDNOTCOMPUTE***
570 ; X64-NEXT: symbolic max exit count for bb10: (-2 + (-1 * %arg1) + (ptrtoint ptr %arg to i64))
571 ; X64-NEXT: Loop %bb8: Unpredictable predicated backedge-taken count.
573 ; X32-LABEL: 'ptrtoint_of_integer'
574 ; X32-NEXT: Classifying expressions for: @ptrtoint_of_integer
575 ; X32-NEXT: %i4 = ptrtoint ptr %arg to i64
576 ; X32-NEXT: --> (zext i32 (ptrtoint ptr %arg to i32) to i64) U: [0,4294967296) S: [0,4294967296)
577 ; X32-NEXT: %i6 = sub i64 %i4, %arg1
578 ; X32-NEXT: --> ((zext i32 (ptrtoint ptr %arg to i32) to i64) + (-1 * %arg1)) U: full-set S: full-set
579 ; X32-NEXT: %i9 = phi i64 [ 1, %bb7 ], [ %i11, %bb10 ]
580 ; X32-NEXT: --> {1,+,1}<nuw><%bb8> U: [1,0) S: [1,0) Exits: <<Unknown>> LoopDispositions: { %bb8: Computable }
581 ; X32-NEXT: %i11 = add nuw i64 %i9, 1
582 ; X32-NEXT: --> {2,+,1}<nw><%bb8> U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %bb8: Computable }
583 ; X32-NEXT: Determining loop execution counts for: @ptrtoint_of_integer
584 ; X32-NEXT: Loop %bb8: <multiple exits> Unpredictable backedge-taken count.
585 ; X32-NEXT: exit count for bb8: ***COULDNOTCOMPUTE***
586 ; X32-NEXT: exit count for bb10: (-2 + (zext i32 (ptrtoint ptr %arg to i32) to i64) + (-1 * %arg1))
587 ; X32-NEXT: Loop %bb8: constant max backedge-taken count is -1
588 ; X32-NEXT: Loop %bb8: symbolic max backedge-taken count is (-2 + (zext i32 (ptrtoint ptr %arg to i32) to i64) + (-1 * %arg1))
589 ; X32-NEXT: symbolic max exit count for bb8: ***COULDNOTCOMPUTE***
590 ; X32-NEXT: symbolic max exit count for bb10: (-2 + (zext i32 (ptrtoint ptr %arg to i32) to i64) + (-1 * %arg1))
591 ; X32-NEXT: Loop %bb8: Unpredictable predicated backedge-taken count.
594 %i = icmp eq ptr %arg, null
595 br i1 %i, label %bb14, label %bb3
598 %i4 = ptrtoint ptr %arg to i64
602 %i6 = sub i64 %i4, %arg1
608 bb8: ; preds = %bb10, %bb7
609 %i9 = phi i64 [ 1, %bb7 ], [ %i11, %bb10 ]
610 br i1 %arg2, label %bb10, label %bb13
613 %i11 = add nuw i64 %i9, 1
614 %i12 = icmp eq i64 %i11, %i6
615 br i1 %i12, label %bb13, label %bb8
617 bb13: ; preds = %bb10, %bb8