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_slt
8 define void @test_pos1_ir_slt(ptr 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, 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 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
37 define void @test_pos2_ir_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
39 %cmp3 = icmp slt i32 9152, %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 [ 9152, %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 slt 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_slt
66 define void @test_pos4_ir_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
68 %cmp3 = icmp slt i32 18851, %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 [ 18851, %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 slt 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_slt
95 define void @test_pos8_ir_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
97 %cmp3 = icmp slt i32 25466, %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 [ 25466, %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 slt 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_slt
124 define void @test_pos16_ir_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
126 %cmp3 = icmp slt i32 9295, %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 [ 9295, %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 slt 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_slt
153 define void @test_pos1_ri_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
155 %cmp3 = icmp slt i32 %a, 31236
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 slt i32 %inc, 31236
171 br i1 %cmp, label %for.body, label %for.end
173 for.end: ; preds = %for.body, %entry
179 ; CHECK: test_pos2_ri_slt
182 define void @test_pos2_ri_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
184 %cmp3 = icmp slt i32 %a, 22653
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 slt i32 %inc, 22653
200 br i1 %cmp, label %for.body, label %for.end
202 for.end: ; preds = %for.body, %entry
208 ; CHECK: test_pos4_ri_slt
211 define void @test_pos4_ri_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
213 %cmp3 = icmp slt i32 %a, 1431
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 slt i32 %inc, 1431
229 br i1 %cmp, label %for.body, label %for.end
231 for.end: ; preds = %for.body, %entry
237 ; CHECK: test_pos8_ri_slt
240 define void @test_pos8_ri_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
242 %cmp3 = icmp slt i32 %a, 22403
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 slt i32 %inc, 22403
258 br i1 %cmp, label %for.body, label %for.end
260 for.end: ; preds = %for.body, %entry
266 ; CHECK: test_pos16_ri_slt
269 define void @test_pos16_ri_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
271 %cmp3 = icmp slt i32 %a, 21715
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 slt i32 %inc, 21715
287 br i1 %cmp, label %for.body, label %for.end
289 for.end: ; preds = %for.body, %entry
295 ; CHECK: test_pos1_rr_slt
298 define void @test_pos1_rr_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
300 %cmp3 = icmp slt i32 %a, %b
301 br i1 %cmp3, label %for.body.lr.ph, label %for.end
303 for.body.lr.ph: ; preds = %entry
306 for.body: ; preds = %for.body.lr.ph, %for.body
307 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
308 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
309 %0 = load i8, ptr %arrayidx, align 1
310 %conv = zext i8 %0 to i32
311 %add = add nsw i32 %conv, 1
312 %conv1 = trunc i32 %add to i8
313 store i8 %conv1, ptr %arrayidx, align 1
314 %inc = add nsw i32 %i.04, 1
315 %cmp = icmp slt i32 %inc, %b
316 br i1 %cmp, label %for.body, label %for.end
318 for.end: ; preds = %for.body, %entry
324 ; CHECK: test_pos2_rr_slt
327 define void @test_pos2_rr_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
329 %cmp3 = icmp slt i32 %a, %b
330 br i1 %cmp3, label %for.body.lr.ph, label %for.end
332 for.body.lr.ph: ; preds = %entry
335 for.body: ; preds = %for.body.lr.ph, %for.body
336 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
337 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
338 %0 = load i8, ptr %arrayidx, align 1
339 %conv = zext i8 %0 to i32
340 %add = add nsw i32 %conv, 1
341 %conv1 = trunc i32 %add to i8
342 store i8 %conv1, ptr %arrayidx, align 1
343 %inc = add nsw i32 %i.04, 2
344 %cmp = icmp slt i32 %inc, %b
345 br i1 %cmp, label %for.body, label %for.end
347 for.end: ; preds = %for.body, %entry
353 ; CHECK: test_pos4_rr_slt
356 define void @test_pos4_rr_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
358 %cmp3 = icmp slt i32 %a, %b
359 br i1 %cmp3, label %for.body.lr.ph, label %for.end
361 for.body.lr.ph: ; preds = %entry
364 for.body: ; preds = %for.body.lr.ph, %for.body
365 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
366 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
367 %0 = load i8, ptr %arrayidx, align 1
368 %conv = zext i8 %0 to i32
369 %add = add nsw i32 %conv, 1
370 %conv1 = trunc i32 %add to i8
371 store i8 %conv1, ptr %arrayidx, align 1
372 %inc = add nsw i32 %i.04, 4
373 %cmp = icmp slt i32 %inc, %b
374 br i1 %cmp, label %for.body, label %for.end
376 for.end: ; preds = %for.body, %entry
382 ; CHECK: test_pos8_rr_slt
385 define void @test_pos8_rr_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
387 %cmp3 = icmp slt i32 %a, %b
388 br i1 %cmp3, label %for.body.lr.ph, label %for.end
390 for.body.lr.ph: ; preds = %entry
393 for.body: ; preds = %for.body.lr.ph, %for.body
394 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
395 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
396 %0 = load i8, ptr %arrayidx, align 1
397 %conv = zext i8 %0 to i32
398 %add = add nsw i32 %conv, 1
399 %conv1 = trunc i32 %add to i8
400 store i8 %conv1, ptr %arrayidx, align 1
401 %inc = add nsw i32 %i.04, 8
402 %cmp = icmp slt i32 %inc, %b
403 br i1 %cmp, label %for.body, label %for.end
405 for.end: ; preds = %for.body, %entry
411 ; CHECK: test_pos16_rr_slt
414 define void @test_pos16_rr_slt(ptr nocapture %p, i32 %a, i32 %b) nounwind {
416 %cmp3 = icmp slt i32 %a, %b
417 br i1 %cmp3, label %for.body.lr.ph, label %for.end
419 for.body.lr.ph: ; preds = %entry
422 for.body: ; preds = %for.body.lr.ph, %for.body
423 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
424 %arrayidx = getelementptr inbounds i8, ptr %p, i32 %i.04
425 %0 = load i8, ptr %arrayidx, align 1
426 %conv = zext i8 %0 to i32
427 %add = add nsw i32 %conv, 1
428 %conv1 = trunc i32 %add to i8
429 store i8 %conv1, ptr %arrayidx, align 1
430 %inc = add nsw i32 %i.04, 16
431 %cmp = icmp slt i32 %inc, %b
432 br i1 %cmp, label %for.body, label %for.end
434 for.end: ; preds = %for.body, %entry