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_sle
8 define void @test_pos1_ir_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
10 %cmp3 = icmp sle i32 28395, %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 [ 28395, %for.body.lr.ph ], [ %inc, %for.body ]
18 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
19 %0 = load i8, ptr %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, ptr %arrayidx, align 1
24 %inc = add nsw i32 %i.04, 1
25 %cmp = icmp sle 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_sle
37 define void @test_pos2_ir_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
39 %cmp3 = icmp sle i32 9073, %b
40 br i1 %cmp3, label %for.body.lr.ph, label %for.end
42 for.body.lr.ph: ; preds = %entry
45 for.body: ; preds = %for.body.lr.ph, %for.body
46 %i.04 = phi i32 [ 9073, %for.body.lr.ph ], [ %inc, %for.body ]
47 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
48 %0 = load i8, ptr %arrayidx, align 1
49 %conv = zext i8 %0 to i32
50 %add = add nsw i32 %conv, 1
51 %conv1 = trunc i32 %add to i8
52 store i8 %conv1, ptr %arrayidx, align 1
53 %inc = add nsw i32 %i.04, 2
54 %cmp = icmp sle i32 %inc, %b
55 br i1 %cmp, label %for.body, label %for.end
57 for.end: ; preds = %for.body, %entry
63 ; CHECK: test_pos4_ir_sle
66 define void @test_pos4_ir_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
68 %cmp3 = icmp sle i32 21956, %b
69 br i1 %cmp3, label %for.body.lr.ph, label %for.end
71 for.body.lr.ph: ; preds = %entry
74 for.body: ; preds = %for.body.lr.ph, %for.body
75 %i.04 = phi i32 [ 21956, %for.body.lr.ph ], [ %inc, %for.body ]
76 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
77 %0 = load i8, ptr %arrayidx, align 1
78 %conv = zext i8 %0 to i32
79 %add = add nsw i32 %conv, 1
80 %conv1 = trunc i32 %add to i8
81 store i8 %conv1, ptr %arrayidx, align 1
82 %inc = add nsw i32 %i.04, 4
83 %cmp = icmp sle i32 %inc, %b
84 br i1 %cmp, label %for.body, label %for.end
86 for.end: ; preds = %for.body, %entry
92 ; CHECK: test_pos8_ir_sle
95 define void @test_pos8_ir_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
97 %cmp3 = icmp sle i32 16782, %b
98 br i1 %cmp3, label %for.body.lr.ph, label %for.end
100 for.body.lr.ph: ; preds = %entry
103 for.body: ; preds = %for.body.lr.ph, %for.body
104 %i.04 = phi i32 [ 16782, %for.body.lr.ph ], [ %inc, %for.body ]
105 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
106 %0 = load i8, ptr %arrayidx, align 1
107 %conv = zext i8 %0 to i32
108 %add = add nsw i32 %conv, 1
109 %conv1 = trunc i32 %add to i8
110 store i8 %conv1, ptr %arrayidx, align 1
111 %inc = add nsw i32 %i.04, 8
112 %cmp = icmp sle i32 %inc, %b
113 br i1 %cmp, label %for.body, label %for.end
115 for.end: ; preds = %for.body, %entry
121 ; CHECK: test_pos16_ir_sle
124 define void @test_pos16_ir_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
126 %cmp3 = icmp sle i32 19097, %b
127 br i1 %cmp3, label %for.body.lr.ph, label %for.end
129 for.body.lr.ph: ; preds = %entry
132 for.body: ; preds = %for.body.lr.ph, %for.body
133 %i.04 = phi i32 [ 19097, %for.body.lr.ph ], [ %inc, %for.body ]
134 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
135 %0 = load i8, ptr %arrayidx, align 1
136 %conv = zext i8 %0 to i32
137 %add = add nsw i32 %conv, 1
138 %conv1 = trunc i32 %add to i8
139 store i8 %conv1, ptr %arrayidx, align 1
140 %inc = add nsw i32 %i.04, 16
141 %cmp = icmp sle i32 %inc, %b
142 br i1 %cmp, label %for.body, label %for.end
144 for.end: ; preds = %for.body, %entry
150 ; CHECK: test_pos1_ri_sle
153 define void @test_pos1_ri_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
155 %cmp3 = icmp sle i32 %a, 14040
156 br i1 %cmp3, label %for.body.lr.ph, label %for.end
158 for.body.lr.ph: ; preds = %entry
161 for.body: ; preds = %for.body.lr.ph, %for.body
162 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
163 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
164 %0 = load i8, ptr %arrayidx, align 1
165 %conv = zext i8 %0 to i32
166 %add = add nsw i32 %conv, 1
167 %conv1 = trunc i32 %add to i8
168 store i8 %conv1, ptr %arrayidx, align 1
169 %inc = add nsw i32 %i.04, 1
170 %cmp = icmp sle i32 %inc, 14040
171 br i1 %cmp, label %for.body, label %for.end
173 for.end: ; preds = %for.body, %entry
179 ; CHECK: test_pos2_ri_sle
182 define void @test_pos2_ri_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
184 %cmp3 = icmp sle i32 %a, 13710
185 br i1 %cmp3, label %for.body.lr.ph, label %for.end
187 for.body.lr.ph: ; preds = %entry
190 for.body: ; preds = %for.body.lr.ph, %for.body
191 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
192 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
193 %0 = load i8, ptr %arrayidx, align 1
194 %conv = zext i8 %0 to i32
195 %add = add nsw i32 %conv, 1
196 %conv1 = trunc i32 %add to i8
197 store i8 %conv1, ptr %arrayidx, align 1
198 %inc = add nsw i32 %i.04, 2
199 %cmp = icmp sle i32 %inc, 13710
200 br i1 %cmp, label %for.body, label %for.end
202 for.end: ; preds = %for.body, %entry
208 ; CHECK: test_pos4_ri_sle
211 define void @test_pos4_ri_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
213 %cmp3 = icmp sle i32 %a, 9920
214 br i1 %cmp3, label %for.body.lr.ph, label %for.end
216 for.body.lr.ph: ; preds = %entry
219 for.body: ; preds = %for.body.lr.ph, %for.body
220 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
221 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
222 %0 = load i8, ptr %arrayidx, align 1
223 %conv = zext i8 %0 to i32
224 %add = add nsw i32 %conv, 1
225 %conv1 = trunc i32 %add to i8
226 store i8 %conv1, ptr %arrayidx, align 1
227 %inc = add nsw i32 %i.04, 4
228 %cmp = icmp sle i32 %inc, 9920
229 br i1 %cmp, label %for.body, label %for.end
231 for.end: ; preds = %for.body, %entry
237 ; CHECK: test_pos8_ri_sle
240 define void @test_pos8_ri_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
242 %cmp3 = icmp sle i32 %a, 18924
243 br i1 %cmp3, label %for.body.lr.ph, label %for.end
245 for.body.lr.ph: ; preds = %entry
248 for.body: ; preds = %for.body.lr.ph, %for.body
249 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
250 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
251 %0 = load i8, ptr %arrayidx, align 1
252 %conv = zext i8 %0 to i32
253 %add = add nsw i32 %conv, 1
254 %conv1 = trunc i32 %add to i8
255 store i8 %conv1, ptr %arrayidx, align 1
256 %inc = add nsw i32 %i.04, 8
257 %cmp = icmp sle i32 %inc, 18924
258 br i1 %cmp, label %for.body, label %for.end
260 for.end: ; preds = %for.body, %entry
266 ; CHECK: test_pos16_ri_sle
269 define void @test_pos16_ri_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
271 %cmp3 = icmp sle i32 %a, 11812
272 br i1 %cmp3, label %for.body.lr.ph, label %for.end
274 for.body.lr.ph: ; preds = %entry
277 for.body: ; preds = %for.body.lr.ph, %for.body
278 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
279 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
280 %0 = load i8, ptr %arrayidx, align 1
281 %conv = zext i8 %0 to i32
282 %add = add nsw i32 %conv, 1
283 %conv1 = trunc i32 %add to i8
284 store i8 %conv1, ptr %arrayidx, align 1
285 %inc = add nsw i32 %i.04, 16
286 %cmp = icmp sle i32 %inc, 11812
287 br i1 %cmp, label %for.body, label %for.end
289 for.end: ; preds = %for.body, %entry
295 ; CHECK: test_pos1_rr_sle
296 ; FIXME: Support this loop!
299 define void @test_pos1_rr_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
301 %cmp3 = icmp sle i32 %a, %b
302 br i1 %cmp3, label %for.body.lr.ph, label %for.end
304 for.body.lr.ph: ; preds = %entry
307 for.body: ; preds = %for.body.lr.ph, %for.body
308 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
309 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
310 %0 = load i8, ptr %arrayidx, align 1
311 %conv = zext i8 %0 to i32
312 %add = add nsw i32 %conv, 1
313 %conv1 = trunc i32 %add to i8
314 store i8 %conv1, ptr %arrayidx, align 1
315 %inc = add nsw i32 %i.04, 1
316 %cmp = icmp sle i32 %inc, %b
317 br i1 %cmp, label %for.body, label %for.end
319 for.end: ; preds = %for.body, %entry
325 ; CHECK: test_pos2_rr_sle
326 ; FIXME: Support this loop!
329 define void @test_pos2_rr_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
331 %cmp3 = icmp sle i32 %a, %b
332 br i1 %cmp3, label %for.body.lr.ph, label %for.end
334 for.body.lr.ph: ; preds = %entry
337 for.body: ; preds = %for.body.lr.ph, %for.body
338 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
339 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
340 %0 = load i8, ptr %arrayidx, align 1
341 %conv = zext i8 %0 to i32
342 %add = add nsw i32 %conv, 1
343 %conv1 = trunc i32 %add to i8
344 store i8 %conv1, ptr %arrayidx, align 1
345 %inc = add nsw i32 %i.04, 2
346 %cmp = icmp sle i32 %inc, %b
347 br i1 %cmp, label %for.body, label %for.end
349 for.end: ; preds = %for.body, %entry
355 ; CHECK: test_pos4_rr_sle
356 ; FIXME: Support this loop!
359 define void @test_pos4_rr_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
361 %cmp3 = icmp sle i32 %a, %b
362 br i1 %cmp3, label %for.body.lr.ph, label %for.end
364 for.body.lr.ph: ; preds = %entry
367 for.body: ; preds = %for.body.lr.ph, %for.body
368 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
369 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
370 %0 = load i8, ptr %arrayidx, align 1
371 %conv = zext i8 %0 to i32
372 %add = add nsw i32 %conv, 1
373 %conv1 = trunc i32 %add to i8
374 store i8 %conv1, ptr %arrayidx, align 1
375 %inc = add nsw i32 %i.04, 4
376 %cmp = icmp sle i32 %inc, %b
377 br i1 %cmp, label %for.body, label %for.end
379 for.end: ; preds = %for.body, %entry
385 ; CHECK: test_pos8_rr_sle
386 ; FIXME: Support this loop!
389 define void @test_pos8_rr_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
391 %cmp3 = icmp sle i32 %a, %b
392 br i1 %cmp3, label %for.body.lr.ph, label %for.end
394 for.body.lr.ph: ; preds = %entry
397 for.body: ; preds = %for.body.lr.ph, %for.body
398 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
399 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
400 %0 = load i8, ptr %arrayidx, align 1
401 %conv = zext i8 %0 to i32
402 %add = add nsw i32 %conv, 1
403 %conv1 = trunc i32 %add to i8
404 store i8 %conv1, ptr %arrayidx, align 1
405 %inc = add nsw i32 %i.04, 8
406 %cmp = icmp sle i32 %inc, %b
407 br i1 %cmp, label %for.body, label %for.end
409 for.end: ; preds = %for.body, %entry
415 ; CHECK: test_pos16_rr_sle
416 ; FIXME: Support this loop!
419 define void @test_pos16_rr_sle(ptr nocapture %p, i32 %a, i32 %b) nounwind {
421 %cmp3 = icmp sle i32 %a, %b
422 br i1 %cmp3, label %for.body.lr.ph, label %for.end
424 for.body.lr.ph: ; preds = %entry
427 for.body: ; preds = %for.body.lr.ph, %for.body
428 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
429 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
430 %0 = load i8, ptr %arrayidx, align 1
431 %conv = zext i8 %0 to i32
432 %add = add nsw i32 %conv, 1
433 %conv1 = trunc i32 %add to i8
434 store i8 %conv1, ptr %arrayidx, align 1
435 %inc = add nsw i32 %i.04, 16
436 %cmp = icmp sle i32 %inc, %b
437 br i1 %cmp, label %for.body, label %for.end
439 for.end: ; preds = %for.body, %entry