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"
8 ; CHECK: test_pos1_ir_sle
11 define void @test_pos1_ir_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
13 %cmp3 = icmp sle i32 28395, %b
14 br i1 %cmp3, label %for.body.lr.ph, label %for.end
16 for.body.lr.ph: ; preds = %entry
19 for.body: ; preds = %for.body.lr.ph, %for.body
20 %i.04 = phi i32 [ 28395, %for.body.lr.ph ], [ %inc, %for.body ]
21 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
22 %0 = load i8, i8* %arrayidx, align 1
23 %conv = zext i8 %0 to i32
24 %add = add nsw i32 %conv, 1
25 %conv1 = trunc i32 %add to i8
26 store i8 %conv1, i8* %arrayidx, align 1
27 %inc = add nsw i32 %i.04, 1
28 %cmp = icmp sle i32 %inc, %b
29 br i1 %cmp, label %for.body, label %for.end
31 for.end: ; preds = %for.body, %entry
37 ; CHECK: test_pos2_ir_sle
40 define void @test_pos2_ir_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
42 %cmp3 = icmp sle i32 9073, %b
43 br i1 %cmp3, label %for.body.lr.ph, label %for.end
45 for.body.lr.ph: ; preds = %entry
48 for.body: ; preds = %for.body.lr.ph, %for.body
49 %i.04 = phi i32 [ 9073, %for.body.lr.ph ], [ %inc, %for.body ]
50 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
51 %0 = load i8, i8* %arrayidx, align 1
52 %conv = zext i8 %0 to i32
53 %add = add nsw i32 %conv, 1
54 %conv1 = trunc i32 %add to i8
55 store i8 %conv1, i8* %arrayidx, align 1
56 %inc = add nsw i32 %i.04, 2
57 %cmp = icmp sle i32 %inc, %b
58 br i1 %cmp, label %for.body, label %for.end
60 for.end: ; preds = %for.body, %entry
66 ; CHECK: test_pos4_ir_sle
69 define void @test_pos4_ir_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
71 %cmp3 = icmp sle i32 21956, %b
72 br i1 %cmp3, label %for.body.lr.ph, label %for.end
74 for.body.lr.ph: ; preds = %entry
77 for.body: ; preds = %for.body.lr.ph, %for.body
78 %i.04 = phi i32 [ 21956, %for.body.lr.ph ], [ %inc, %for.body ]
79 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
80 %0 = load i8, i8* %arrayidx, align 1
81 %conv = zext i8 %0 to i32
82 %add = add nsw i32 %conv, 1
83 %conv1 = trunc i32 %add to i8
84 store i8 %conv1, i8* %arrayidx, align 1
85 %inc = add nsw i32 %i.04, 4
86 %cmp = icmp sle i32 %inc, %b
87 br i1 %cmp, label %for.body, label %for.end
89 for.end: ; preds = %for.body, %entry
95 ; CHECK: test_pos8_ir_sle
98 define void @test_pos8_ir_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
100 %cmp3 = icmp sle i32 16782, %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 [ 16782, %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 sle 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_sle
127 define void @test_pos16_ir_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
129 %cmp3 = icmp sle i32 19097, %b
130 br i1 %cmp3, label %for.body.lr.ph, label %for.end
132 for.body.lr.ph: ; preds = %entry
135 for.body: ; preds = %for.body.lr.ph, %for.body
136 %i.04 = phi i32 [ 19097, %for.body.lr.ph ], [ %inc, %for.body ]
137 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
138 %0 = load i8, i8* %arrayidx, align 1
139 %conv = zext i8 %0 to i32
140 %add = add nsw i32 %conv, 1
141 %conv1 = trunc i32 %add to i8
142 store i8 %conv1, i8* %arrayidx, align 1
143 %inc = add nsw i32 %i.04, 16
144 %cmp = icmp sle i32 %inc, %b
145 br i1 %cmp, label %for.body, label %for.end
147 for.end: ; preds = %for.body, %entry
153 ; CHECK: test_pos1_ri_sle
156 define void @test_pos1_ri_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
158 %cmp3 = icmp sle i32 %a, 14040
159 br i1 %cmp3, label %for.body.lr.ph, label %for.end
161 for.body.lr.ph: ; preds = %entry
164 for.body: ; preds = %for.body.lr.ph, %for.body
165 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
166 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
167 %0 = load i8, i8* %arrayidx, align 1
168 %conv = zext i8 %0 to i32
169 %add = add nsw i32 %conv, 1
170 %conv1 = trunc i32 %add to i8
171 store i8 %conv1, i8* %arrayidx, align 1
172 %inc = add nsw i32 %i.04, 1
173 %cmp = icmp sle i32 %inc, 14040
174 br i1 %cmp, label %for.body, label %for.end
176 for.end: ; preds = %for.body, %entry
182 ; CHECK: test_pos2_ri_sle
185 define void @test_pos2_ri_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
187 %cmp3 = icmp sle i32 %a, 13710
188 br i1 %cmp3, label %for.body.lr.ph, label %for.end
190 for.body.lr.ph: ; preds = %entry
193 for.body: ; preds = %for.body.lr.ph, %for.body
194 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
195 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
196 %0 = load i8, i8* %arrayidx, align 1
197 %conv = zext i8 %0 to i32
198 %add = add nsw i32 %conv, 1
199 %conv1 = trunc i32 %add to i8
200 store i8 %conv1, i8* %arrayidx, align 1
201 %inc = add nsw i32 %i.04, 2
202 %cmp = icmp sle i32 %inc, 13710
203 br i1 %cmp, label %for.body, label %for.end
205 for.end: ; preds = %for.body, %entry
211 ; CHECK: test_pos4_ri_sle
214 define void @test_pos4_ri_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
216 %cmp3 = icmp sle i32 %a, 9920
217 br i1 %cmp3, label %for.body.lr.ph, label %for.end
219 for.body.lr.ph: ; preds = %entry
222 for.body: ; preds = %for.body.lr.ph, %for.body
223 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
224 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
225 %0 = load i8, i8* %arrayidx, align 1
226 %conv = zext i8 %0 to i32
227 %add = add nsw i32 %conv, 1
228 %conv1 = trunc i32 %add to i8
229 store i8 %conv1, i8* %arrayidx, align 1
230 %inc = add nsw i32 %i.04, 4
231 %cmp = icmp sle i32 %inc, 9920
232 br i1 %cmp, label %for.body, label %for.end
234 for.end: ; preds = %for.body, %entry
240 ; CHECK: test_pos8_ri_sle
243 define void @test_pos8_ri_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
245 %cmp3 = icmp sle i32 %a, 18924
246 br i1 %cmp3, label %for.body.lr.ph, label %for.end
248 for.body.lr.ph: ; preds = %entry
251 for.body: ; preds = %for.body.lr.ph, %for.body
252 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
253 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
254 %0 = load i8, i8* %arrayidx, align 1
255 %conv = zext i8 %0 to i32
256 %add = add nsw i32 %conv, 1
257 %conv1 = trunc i32 %add to i8
258 store i8 %conv1, i8* %arrayidx, align 1
259 %inc = add nsw i32 %i.04, 8
260 %cmp = icmp sle i32 %inc, 18924
261 br i1 %cmp, label %for.body, label %for.end
263 for.end: ; preds = %for.body, %entry
269 ; CHECK: test_pos16_ri_sle
272 define void @test_pos16_ri_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
274 %cmp3 = icmp sle i32 %a, 11812
275 br i1 %cmp3, label %for.body.lr.ph, label %for.end
277 for.body.lr.ph: ; preds = %entry
280 for.body: ; preds = %for.body.lr.ph, %for.body
281 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
282 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
283 %0 = load i8, i8* %arrayidx, align 1
284 %conv = zext i8 %0 to i32
285 %add = add nsw i32 %conv, 1
286 %conv1 = trunc i32 %add to i8
287 store i8 %conv1, i8* %arrayidx, align 1
288 %inc = add nsw i32 %i.04, 16
289 %cmp = icmp sle i32 %inc, 11812
290 br i1 %cmp, label %for.body, label %for.end
292 for.end: ; preds = %for.body, %entry
298 ; CHECK: test_pos1_rr_sle
299 ; FIXME: Support this loop!
302 define void @test_pos1_rr_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
304 %cmp3 = icmp sle 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, i8* %p, i32 %i.04
313 %0 = load i8, 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 sle 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_sle
329 ; FIXME: Support this loop!
332 define void @test_pos2_rr_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
334 %cmp3 = icmp sle 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, i8* %p, i32 %i.04
343 %0 = load i8, 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 sle 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_sle
359 ; FIXME: Support this loop!
362 define void @test_pos4_rr_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
364 %cmp3 = icmp sle 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, i8* %p, i32 %i.04
373 %0 = load i8, 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 sle 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_sle
389 ; FIXME: Support this loop!
392 define void @test_pos8_rr_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
394 %cmp3 = icmp sle 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, i8* %p, i32 %i.04
403 %0 = load i8, 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 sle 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_sle
419 ; FIXME: Support this loop!
422 define void @test_pos16_rr_sle(i8* nocapture %p, i32 %a, i32 %b) nounwind {
424 %cmp3 = icmp sle 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, i8* %p, i32 %i.04
433 %0 = load i8, 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 sle i32 %inc, %b
440 br i1 %cmp, label %for.body, label %for.end
442 for.end: ; preds = %for.body, %entry