1 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"
2 target triple = "powerpc64-unknown-linux-gnu"
3 ; RUN: llc < %s -march=ppc64 | FileCheck %s
5 ; CHECK: test_pos1_ir_slt
8 define void @test_pos1_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
10 %cmp3 = icmp slt i32 8531, %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 [ 8531, %for.body.lr.ph ], [ %inc, %for.body ]
18 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
19 %0 = load 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 slt 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_slt
35 ; FIXME: Support this loop!
38 define void @test_pos2_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
40 %cmp3 = icmp slt i32 9152, %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 [ 9152, %for.body.lr.ph ], [ %inc, %for.body ]
48 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
49 %0 = load 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 slt 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_slt
65 ; FIXME: Support this loop!
68 define void @test_pos4_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
70 %cmp3 = icmp slt i32 18851, %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 [ 18851, %for.body.lr.ph ], [ %inc, %for.body ]
78 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
79 %0 = load 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 slt 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_slt
95 ; FIXME: Support this loop!
98 define void @test_pos8_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
100 %cmp3 = icmp slt i32 25466, %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 [ 25466, %for.body.lr.ph ], [ %inc, %for.body ]
108 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
109 %0 = load 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 slt 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_slt
125 ; FIXME: Support this loop!
128 define void @test_pos16_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
130 %cmp3 = icmp slt i32 9295, %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 [ 9295, %for.body.lr.ph ], [ %inc, %for.body ]
138 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
139 %0 = load 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 slt 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_slt
157 define void @test_pos1_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
159 %cmp3 = icmp slt i32 %a, 31236
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* %p, i32 %i.04
168 %0 = load 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 slt i32 %inc, 31236
175 br i1 %cmp, label %for.body, label %for.end
177 for.end: ; preds = %for.body, %entry
183 ; CHECK: test_pos2_ri_slt
186 define void @test_pos2_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
188 %cmp3 = icmp slt i32 %a, 22653
189 br i1 %cmp3, label %for.body.lr.ph, label %for.end
191 for.body.lr.ph: ; preds = %entry
194 for.body: ; preds = %for.body.lr.ph, %for.body
195 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
196 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
197 %0 = load i8* %arrayidx, align 1
198 %conv = zext i8 %0 to i32
199 %add = add nsw i32 %conv, 1
200 %conv1 = trunc i32 %add to i8
201 store i8 %conv1, i8* %arrayidx, align 1
202 %inc = add nsw i32 %i.04, 2
203 %cmp = icmp slt i32 %inc, 22653
204 br i1 %cmp, label %for.body, label %for.end
206 for.end: ; preds = %for.body, %entry
212 ; CHECK: test_pos4_ri_slt
215 define void @test_pos4_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
217 %cmp3 = icmp slt i32 %a, 1431
218 br i1 %cmp3, label %for.body.lr.ph, label %for.end
220 for.body.lr.ph: ; preds = %entry
223 for.body: ; preds = %for.body.lr.ph, %for.body
224 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
225 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
226 %0 = load i8* %arrayidx, align 1
227 %conv = zext i8 %0 to i32
228 %add = add nsw i32 %conv, 1
229 %conv1 = trunc i32 %add to i8
230 store i8 %conv1, i8* %arrayidx, align 1
231 %inc = add nsw i32 %i.04, 4
232 %cmp = icmp slt i32 %inc, 1431
233 br i1 %cmp, label %for.body, label %for.end
235 for.end: ; preds = %for.body, %entry
241 ; CHECK: test_pos8_ri_slt
244 define void @test_pos8_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
246 %cmp3 = icmp slt i32 %a, 22403
247 br i1 %cmp3, label %for.body.lr.ph, label %for.end
249 for.body.lr.ph: ; preds = %entry
252 for.body: ; preds = %for.body.lr.ph, %for.body
253 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
254 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
255 %0 = load i8* %arrayidx, align 1
256 %conv = zext i8 %0 to i32
257 %add = add nsw i32 %conv, 1
258 %conv1 = trunc i32 %add to i8
259 store i8 %conv1, i8* %arrayidx, align 1
260 %inc = add nsw i32 %i.04, 8
261 %cmp = icmp slt i32 %inc, 22403
262 br i1 %cmp, label %for.body, label %for.end
264 for.end: ; preds = %for.body, %entry
270 ; CHECK: test_pos16_ri_slt
273 define void @test_pos16_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
275 %cmp3 = icmp slt i32 %a, 21715
276 br i1 %cmp3, label %for.body.lr.ph, label %for.end
278 for.body.lr.ph: ; preds = %entry
281 for.body: ; preds = %for.body.lr.ph, %for.body
282 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
283 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
284 %0 = load i8* %arrayidx, align 1
285 %conv = zext i8 %0 to i32
286 %add = add nsw i32 %conv, 1
287 %conv1 = trunc i32 %add to i8
288 store i8 %conv1, i8* %arrayidx, align 1
289 %inc = add nsw i32 %i.04, 16
290 %cmp = icmp slt i32 %inc, 21715
291 br i1 %cmp, label %for.body, label %for.end
293 for.end: ; preds = %for.body, %entry
299 ; CHECK: test_pos1_rr_slt
302 define void @test_pos1_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
304 %cmp3 = icmp slt i32 %a, %b
305 br i1 %cmp3, label %for.body.lr.ph, label %for.end
307 for.body.lr.ph: ; preds = %entry
310 for.body: ; preds = %for.body.lr.ph, %for.body
311 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
312 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
313 %0 = load i8* %arrayidx, align 1
314 %conv = zext i8 %0 to i32
315 %add = add nsw i32 %conv, 1
316 %conv1 = trunc i32 %add to i8
317 store i8 %conv1, i8* %arrayidx, align 1
318 %inc = add nsw i32 %i.04, 1
319 %cmp = icmp slt i32 %inc, %b
320 br i1 %cmp, label %for.body, label %for.end
322 for.end: ; preds = %for.body, %entry
328 ; CHECK: test_pos2_rr_slt
329 ; FIXME: Support this loop!
332 define void @test_pos2_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
334 %cmp3 = icmp slt i32 %a, %b
335 br i1 %cmp3, label %for.body.lr.ph, label %for.end
337 for.body.lr.ph: ; preds = %entry
340 for.body: ; preds = %for.body.lr.ph, %for.body
341 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
342 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
343 %0 = load i8* %arrayidx, align 1
344 %conv = zext i8 %0 to i32
345 %add = add nsw i32 %conv, 1
346 %conv1 = trunc i32 %add to i8
347 store i8 %conv1, i8* %arrayidx, align 1
348 %inc = add nsw i32 %i.04, 2
349 %cmp = icmp slt i32 %inc, %b
350 br i1 %cmp, label %for.body, label %for.end
352 for.end: ; preds = %for.body, %entry
358 ; CHECK: test_pos4_rr_slt
359 ; FIXME: Support this loop!
362 define void @test_pos4_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
364 %cmp3 = icmp slt i32 %a, %b
365 br i1 %cmp3, label %for.body.lr.ph, label %for.end
367 for.body.lr.ph: ; preds = %entry
370 for.body: ; preds = %for.body.lr.ph, %for.body
371 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
372 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
373 %0 = load i8* %arrayidx, align 1
374 %conv = zext i8 %0 to i32
375 %add = add nsw i32 %conv, 1
376 %conv1 = trunc i32 %add to i8
377 store i8 %conv1, i8* %arrayidx, align 1
378 %inc = add nsw i32 %i.04, 4
379 %cmp = icmp slt i32 %inc, %b
380 br i1 %cmp, label %for.body, label %for.end
382 for.end: ; preds = %for.body, %entry
388 ; CHECK: test_pos8_rr_slt
389 ; FIXME: Support this loop!
392 define void @test_pos8_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
394 %cmp3 = icmp slt i32 %a, %b
395 br i1 %cmp3, label %for.body.lr.ph, label %for.end
397 for.body.lr.ph: ; preds = %entry
400 for.body: ; preds = %for.body.lr.ph, %for.body
401 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
402 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
403 %0 = load i8* %arrayidx, align 1
404 %conv = zext i8 %0 to i32
405 %add = add nsw i32 %conv, 1
406 %conv1 = trunc i32 %add to i8
407 store i8 %conv1, i8* %arrayidx, align 1
408 %inc = add nsw i32 %i.04, 8
409 %cmp = icmp slt i32 %inc, %b
410 br i1 %cmp, label %for.body, label %for.end
412 for.end: ; preds = %for.body, %entry
418 ; CHECK: test_pos16_rr_slt
419 ; FIXME: Support this loop!
422 define void @test_pos16_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
424 %cmp3 = icmp slt i32 %a, %b
425 br i1 %cmp3, label %for.body.lr.ph, label %for.end
427 for.body.lr.ph: ; preds = %entry
430 for.body: ; preds = %for.body.lr.ph, %for.body
431 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
432 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
433 %0 = load i8* %arrayidx, align 1
434 %conv = zext i8 %0 to i32
435 %add = add nsw i32 %conv, 1
436 %conv1 = trunc i32 %add to i8
437 store i8 %conv1, i8* %arrayidx, align 1
438 %inc = add nsw i32 %i.04, 16
439 %cmp = icmp slt i32 %inc, %b
440 br i1 %cmp, label %for.body, label %for.end
442 for.end: ; preds = %for.body, %entry