1 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
5 ; CHECK: test_pos1_ir_ne
8 define void @test_pos1_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
10 %cmp3 = icmp slt i32 32623, %b
11 br i1 %cmp3, label %for.body.lr.ph, label %for.end
13 for.body.lr.ph: ; preds = %entry
16 for.body: ; preds = %for.body.lr.ph, %for.body
17 %i.04 = phi i32 [ 32623, %for.body.lr.ph ], [ %inc, %for.body ]
18 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
19 %0 = load i8, i8* %arrayidx, align 1
20 %conv = zext i8 %0 to i32
21 %add = add nsw i32 %conv, 1
22 %conv1 = trunc i32 %add to i8
23 store i8 %conv1, i8* %arrayidx, align 1
24 %inc = add nsw i32 %i.04, 1
25 %cmp = icmp ne i32 %inc, %b
26 br i1 %cmp, label %for.body, label %for.end
28 for.end: ; preds = %for.body, %entry
34 ; CHECK: test_pos2_ir_ne
35 ; FIXME: Support this loop!
38 define void @test_pos2_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
40 %cmp3 = icmp slt i32 29554, %b
41 br i1 %cmp3, label %for.body.lr.ph, label %for.end
43 for.body.lr.ph: ; preds = %entry
46 for.body: ; preds = %for.body.lr.ph, %for.body
47 %i.04 = phi i32 [ 29554, %for.body.lr.ph ], [ %inc, %for.body ]
48 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
49 %0 = load i8, i8* %arrayidx, align 1
50 %conv = zext i8 %0 to i32
51 %add = add nsw i32 %conv, 1
52 %conv1 = trunc i32 %add to i8
53 store i8 %conv1, i8* %arrayidx, align 1
54 %inc = add nsw i32 %i.04, 2
55 %cmp = icmp ne i32 %inc, %b
56 br i1 %cmp, label %for.body, label %for.end
58 for.end: ; preds = %for.body, %entry
64 ; CHECK: test_pos4_ir_ne
65 ; FIXME: Support this loop!
68 define void @test_pos4_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
70 %cmp3 = icmp slt i32 15692, %b
71 br i1 %cmp3, label %for.body.lr.ph, label %for.end
73 for.body.lr.ph: ; preds = %entry
76 for.body: ; preds = %for.body.lr.ph, %for.body
77 %i.04 = phi i32 [ 15692, %for.body.lr.ph ], [ %inc, %for.body ]
78 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
79 %0 = load i8, i8* %arrayidx, align 1
80 %conv = zext i8 %0 to i32
81 %add = add nsw i32 %conv, 1
82 %conv1 = trunc i32 %add to i8
83 store i8 %conv1, i8* %arrayidx, align 1
84 %inc = add nsw i32 %i.04, 4
85 %cmp = icmp ne i32 %inc, %b
86 br i1 %cmp, label %for.body, label %for.end
88 for.end: ; preds = %for.body, %entry
94 ; CHECK: test_pos8_ir_ne
95 ; FIXME: Support this loop!
98 define void @test_pos8_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
100 %cmp3 = icmp slt i32 10449, %b
101 br i1 %cmp3, label %for.body.lr.ph, label %for.end
103 for.body.lr.ph: ; preds = %entry
106 for.body: ; preds = %for.body.lr.ph, %for.body
107 %i.04 = phi i32 [ 10449, %for.body.lr.ph ], [ %inc, %for.body ]
108 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
109 %0 = load i8, i8* %arrayidx, align 1
110 %conv = zext i8 %0 to i32
111 %add = add nsw i32 %conv, 1
112 %conv1 = trunc i32 %add to i8
113 store i8 %conv1, i8* %arrayidx, align 1
114 %inc = add nsw i32 %i.04, 8
115 %cmp = icmp ne i32 %inc, %b
116 br i1 %cmp, label %for.body, label %for.end
118 for.end: ; preds = %for.body, %entry
124 ; CHECK: test_pos16_ir_ne
125 ; FIXME: Support this loop!
128 define void @test_pos16_ir_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
130 %cmp3 = icmp slt i32 32087, %b
131 br i1 %cmp3, label %for.body.lr.ph, label %for.end
133 for.body.lr.ph: ; preds = %entry
136 for.body: ; preds = %for.body.lr.ph, %for.body
137 %i.04 = phi i32 [ 32087, %for.body.lr.ph ], [ %inc, %for.body ]
138 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
139 %0 = load i8, i8* %arrayidx, align 1
140 %conv = zext i8 %0 to i32
141 %add = add nsw i32 %conv, 1
142 %conv1 = trunc i32 %add to i8
143 store i8 %conv1, i8* %arrayidx, align 1
144 %inc = add nsw i32 %i.04, 16
145 %cmp = icmp ne i32 %inc, %b
146 br i1 %cmp, label %for.body, label %for.end
148 for.end: ; preds = %for.body, %entry
154 ; CHECK: test_pos1_ri_ne
157 define void @test_pos1_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
159 %cmp3 = icmp slt i32 %a, 3472
160 br i1 %cmp3, label %for.body.lr.ph, label %for.end
162 for.body.lr.ph: ; preds = %entry
165 for.body: ; preds = %for.body.lr.ph, %for.body
166 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
167 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
168 %0 = load i8, i8* %arrayidx, align 1
169 %conv = zext i8 %0 to i32
170 %add = add nsw i32 %conv, 1
171 %conv1 = trunc i32 %add to i8
172 store i8 %conv1, i8* %arrayidx, align 1
173 %inc = add nsw i32 %i.04, 1
174 %cmp = icmp ne i32 %inc, 3472
175 br i1 %cmp, label %for.body, label %for.end
177 for.end: ; preds = %for.body, %entry
183 ; CHECK: test_pos2_ri_ne
184 ; FIXME: Support this loop!
187 define void @test_pos2_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
189 %cmp3 = icmp slt i32 %a, 8730
190 br i1 %cmp3, label %for.body.lr.ph, label %for.end
192 for.body.lr.ph: ; preds = %entry
195 for.body: ; preds = %for.body.lr.ph, %for.body
196 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
197 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
198 %0 = load i8, i8* %arrayidx, align 1
199 %conv = zext i8 %0 to i32
200 %add = add nsw i32 %conv, 1
201 %conv1 = trunc i32 %add to i8
202 store i8 %conv1, i8* %arrayidx, align 1
203 %inc = add nsw i32 %i.04, 2
204 %cmp = icmp ne i32 %inc, 8730
205 br i1 %cmp, label %for.body, label %for.end
207 for.end: ; preds = %for.body, %entry
213 ; CHECK: test_pos4_ri_ne
214 ; FIXME: Support this loop!
217 define void @test_pos4_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
219 %cmp3 = icmp slt i32 %a, 1493
220 br i1 %cmp3, label %for.body.lr.ph, label %for.end
222 for.body.lr.ph: ; preds = %entry
225 for.body: ; preds = %for.body.lr.ph, %for.body
226 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
227 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
228 %0 = load i8, i8* %arrayidx, align 1
229 %conv = zext i8 %0 to i32
230 %add = add nsw i32 %conv, 1
231 %conv1 = trunc i32 %add to i8
232 store i8 %conv1, i8* %arrayidx, align 1
233 %inc = add nsw i32 %i.04, 4
234 %cmp = icmp ne i32 %inc, 1493
235 br i1 %cmp, label %for.body, label %for.end
237 for.end: ; preds = %for.body, %entry
243 ; CHECK: test_pos8_ri_ne
244 ; FIXME: Support this loop!
247 define void @test_pos8_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
249 %cmp3 = icmp slt i32 %a, 1706
250 br i1 %cmp3, label %for.body.lr.ph, label %for.end
252 for.body.lr.ph: ; preds = %entry
255 for.body: ; preds = %for.body.lr.ph, %for.body
256 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
257 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
258 %0 = load i8, i8* %arrayidx, align 1
259 %conv = zext i8 %0 to i32
260 %add = add nsw i32 %conv, 1
261 %conv1 = trunc i32 %add to i8
262 store i8 %conv1, i8* %arrayidx, align 1
263 %inc = add nsw i32 %i.04, 8
264 %cmp = icmp ne i32 %inc, 1706
265 br i1 %cmp, label %for.body, label %for.end
267 for.end: ; preds = %for.body, %entry
273 ; CHECK: test_pos16_ri_ne
274 ; FIXME: Support this loop!
277 define void @test_pos16_ri_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
279 %cmp3 = icmp slt i32 %a, 1886
280 br i1 %cmp3, label %for.body.lr.ph, label %for.end
282 for.body.lr.ph: ; preds = %entry
285 for.body: ; preds = %for.body.lr.ph, %for.body
286 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
287 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
288 %0 = load i8, i8* %arrayidx, align 1
289 %conv = zext i8 %0 to i32
290 %add = add nsw i32 %conv, 1
291 %conv1 = trunc i32 %add to i8
292 store i8 %conv1, i8* %arrayidx, align 1
293 %inc = add nsw i32 %i.04, 16
294 %cmp = icmp ne i32 %inc, 1886
295 br i1 %cmp, label %for.body, label %for.end
297 for.end: ; preds = %for.body, %entry
303 ; CHECK: test_pos1_rr_ne
306 define void @test_pos1_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
308 %cmp3 = icmp slt i32 %a, %b
309 br i1 %cmp3, label %for.body.lr.ph, label %for.end
311 for.body.lr.ph: ; preds = %entry
314 for.body: ; preds = %for.body.lr.ph, %for.body
315 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
316 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
317 %0 = load i8, i8* %arrayidx, align 1
318 %conv = zext i8 %0 to i32
319 %add = add nsw i32 %conv, 1
320 %conv1 = trunc i32 %add to i8
321 store i8 %conv1, i8* %arrayidx, align 1
322 %inc = add nsw i32 %i.04, 1
323 %cmp = icmp ne i32 %inc, %b
324 br i1 %cmp, label %for.body, label %for.end
326 for.end: ; preds = %for.body, %entry
332 ; CHECK: test_pos2_rr_ne
333 ; FIXME: Support this loop!
336 define void @test_pos2_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
338 %cmp3 = icmp slt i32 %a, %b
339 br i1 %cmp3, label %for.body.lr.ph, label %for.end
341 for.body.lr.ph: ; preds = %entry
344 for.body: ; preds = %for.body.lr.ph, %for.body
345 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
346 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
347 %0 = load i8, i8* %arrayidx, align 1
348 %conv = zext i8 %0 to i32
349 %add = add nsw i32 %conv, 1
350 %conv1 = trunc i32 %add to i8
351 store i8 %conv1, i8* %arrayidx, align 1
352 %inc = add nsw i32 %i.04, 2
353 %cmp = icmp ne i32 %inc, %b
354 br i1 %cmp, label %for.body, label %for.end
356 for.end: ; preds = %for.body, %entry
362 ; CHECK: test_pos4_rr_ne
363 ; FIXME: Support this loop!
366 define void @test_pos4_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
368 %cmp3 = icmp slt i32 %a, %b
369 br i1 %cmp3, label %for.body.lr.ph, label %for.end
371 for.body.lr.ph: ; preds = %entry
374 for.body: ; preds = %for.body.lr.ph, %for.body
375 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
376 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
377 %0 = load i8, i8* %arrayidx, align 1
378 %conv = zext i8 %0 to i32
379 %add = add nsw i32 %conv, 1
380 %conv1 = trunc i32 %add to i8
381 store i8 %conv1, i8* %arrayidx, align 1
382 %inc = add nsw i32 %i.04, 4
383 %cmp = icmp ne i32 %inc, %b
384 br i1 %cmp, label %for.body, label %for.end
386 for.end: ; preds = %for.body, %entry
392 ; CHECK: test_pos8_rr_ne
393 ; FIXME: Support this loop!
396 define void @test_pos8_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
398 %cmp3 = icmp slt i32 %a, %b
399 br i1 %cmp3, label %for.body.lr.ph, label %for.end
401 for.body.lr.ph: ; preds = %entry
404 for.body: ; preds = %for.body.lr.ph, %for.body
405 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
406 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
407 %0 = load i8, i8* %arrayidx, align 1
408 %conv = zext i8 %0 to i32
409 %add = add nsw i32 %conv, 1
410 %conv1 = trunc i32 %add to i8
411 store i8 %conv1, i8* %arrayidx, align 1
412 %inc = add nsw i32 %i.04, 8
413 %cmp = icmp ne i32 %inc, %b
414 br i1 %cmp, label %for.body, label %for.end
416 for.end: ; preds = %for.body, %entry
422 ; CHECK: test_pos16_rr_ne
423 ; FIXME: Support this loop!
426 define void @test_pos16_rr_ne(i8* nocapture %p, i32 %a, i32 %b) nounwind {
428 %cmp3 = icmp slt i32 %a, %b
429 br i1 %cmp3, label %for.body.lr.ph, label %for.end
431 for.body.lr.ph: ; preds = %entry
434 for.body: ; preds = %for.body.lr.ph, %for.body
435 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
436 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
437 %0 = load i8, i8* %arrayidx, align 1
438 %conv = zext i8 %0 to i32
439 %add = add nsw i32 %conv, 1
440 %conv1 = trunc i32 %add to i8
441 store i8 %conv1, i8* %arrayidx, align 1
442 %inc = add nsw i32 %i.04, 16
443 %cmp = icmp ne i32 %inc, %b
444 br i1 %cmp, label %for.body, label %for.end
446 for.end: ; preds = %for.body, %entry