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_slt
11 define void @test_pos1_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
13 %cmp3 = icmp slt i32 8531, %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 [ 8531, %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 slt 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_slt
38 ; FIXME: Support this loop!
41 define void @test_pos2_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
43 %cmp3 = icmp slt i32 9152, %b
44 br i1 %cmp3, label %for.body.lr.ph, label %for.end
46 for.body.lr.ph: ; preds = %entry
49 for.body: ; preds = %for.body.lr.ph, %for.body
50 %i.04 = phi i32 [ 9152, %for.body.lr.ph ], [ %inc, %for.body ]
51 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
52 %0 = load i8, i8* %arrayidx, align 1
53 %conv = zext i8 %0 to i32
54 %add = add nsw i32 %conv, 1
55 %conv1 = trunc i32 %add to i8
56 store i8 %conv1, i8* %arrayidx, align 1
57 %inc = add nsw i32 %i.04, 2
58 %cmp = icmp slt i32 %inc, %b
59 br i1 %cmp, label %for.body, label %for.end
61 for.end: ; preds = %for.body, %entry
67 ; CHECK: test_pos4_ir_slt
68 ; FIXME: Support this loop!
71 define void @test_pos4_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
73 %cmp3 = icmp slt i32 18851, %b
74 br i1 %cmp3, label %for.body.lr.ph, label %for.end
76 for.body.lr.ph: ; preds = %entry
79 for.body: ; preds = %for.body.lr.ph, %for.body
80 %i.04 = phi i32 [ 18851, %for.body.lr.ph ], [ %inc, %for.body ]
81 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
82 %0 = load i8, i8* %arrayidx, align 1
83 %conv = zext i8 %0 to i32
84 %add = add nsw i32 %conv, 1
85 %conv1 = trunc i32 %add to i8
86 store i8 %conv1, i8* %arrayidx, align 1
87 %inc = add nsw i32 %i.04, 4
88 %cmp = icmp slt i32 %inc, %b
89 br i1 %cmp, label %for.body, label %for.end
91 for.end: ; preds = %for.body, %entry
97 ; CHECK: test_pos8_ir_slt
100 define void @test_pos8_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
102 %cmp3 = icmp slt i32 25466, %b
103 br i1 %cmp3, label %for.body.lr.ph, label %for.end
105 for.body.lr.ph: ; preds = %entry
108 for.body: ; preds = %for.body.lr.ph, %for.body
109 %i.04 = phi i32 [ 25466, %for.body.lr.ph ], [ %inc, %for.body ]
110 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
111 %0 = load i8, i8* %arrayidx, align 1
112 %conv = zext i8 %0 to i32
113 %add = add nsw i32 %conv, 1
114 %conv1 = trunc i32 %add to i8
115 store i8 %conv1, i8* %arrayidx, align 1
116 %inc = add nsw i32 %i.04, 8
117 %cmp = icmp slt i32 %inc, %b
118 br i1 %cmp, label %for.body, label %for.end
120 for.end: ; preds = %for.body, %entry
126 ; CHECK: test_pos16_ir_slt
129 define void @test_pos16_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
131 %cmp3 = icmp slt i32 9295, %b
132 br i1 %cmp3, label %for.body.lr.ph, label %for.end
134 for.body.lr.ph: ; preds = %entry
137 for.body: ; preds = %for.body.lr.ph, %for.body
138 %i.04 = phi i32 [ 9295, %for.body.lr.ph ], [ %inc, %for.body ]
139 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
140 %0 = load i8, i8* %arrayidx, align 1
141 %conv = zext i8 %0 to i32
142 %add = add nsw i32 %conv, 1
143 %conv1 = trunc i32 %add to i8
144 store i8 %conv1, i8* %arrayidx, align 1
145 %inc = add nsw i32 %i.04, 16
146 %cmp = icmp slt i32 %inc, %b
147 br i1 %cmp, label %for.body, label %for.end
149 for.end: ; preds = %for.body, %entry
155 ; CHECK: test_pos1_ri_slt
158 define void @test_pos1_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
160 %cmp3 = icmp slt i32 %a, 31236
161 br i1 %cmp3, label %for.body.lr.ph, label %for.end
163 for.body.lr.ph: ; preds = %entry
166 for.body: ; preds = %for.body.lr.ph, %for.body
167 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
168 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
169 %0 = load i8, i8* %arrayidx, align 1
170 %conv = zext i8 %0 to i32
171 %add = add nsw i32 %conv, 1
172 %conv1 = trunc i32 %add to i8
173 store i8 %conv1, i8* %arrayidx, align 1
174 %inc = add nsw i32 %i.04, 1
175 %cmp = icmp slt i32 %inc, 31236
176 br i1 %cmp, label %for.body, label %for.end
178 for.end: ; preds = %for.body, %entry
184 ; CHECK: test_pos2_ri_slt
187 define void @test_pos2_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
189 %cmp3 = icmp slt i32 %a, 22653
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 slt i32 %inc, 22653
205 br i1 %cmp, label %for.body, label %for.end
207 for.end: ; preds = %for.body, %entry
213 ; CHECK: test_pos4_ri_slt
216 define void @test_pos4_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
218 %cmp3 = icmp slt i32 %a, 1431
219 br i1 %cmp3, label %for.body.lr.ph, label %for.end
221 for.body.lr.ph: ; preds = %entry
224 for.body: ; preds = %for.body.lr.ph, %for.body
225 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
226 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
227 %0 = load i8, i8* %arrayidx, align 1
228 %conv = zext i8 %0 to i32
229 %add = add nsw i32 %conv, 1
230 %conv1 = trunc i32 %add to i8
231 store i8 %conv1, i8* %arrayidx, align 1
232 %inc = add nsw i32 %i.04, 4
233 %cmp = icmp slt i32 %inc, 1431
234 br i1 %cmp, label %for.body, label %for.end
236 for.end: ; preds = %for.body, %entry
242 ; CHECK: test_pos8_ri_slt
245 define void @test_pos8_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
247 %cmp3 = icmp slt i32 %a, 22403
248 br i1 %cmp3, label %for.body.lr.ph, label %for.end
250 for.body.lr.ph: ; preds = %entry
253 for.body: ; preds = %for.body.lr.ph, %for.body
254 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
255 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
256 %0 = load i8, i8* %arrayidx, align 1
257 %conv = zext i8 %0 to i32
258 %add = add nsw i32 %conv, 1
259 %conv1 = trunc i32 %add to i8
260 store i8 %conv1, i8* %arrayidx, align 1
261 %inc = add nsw i32 %i.04, 8
262 %cmp = icmp slt i32 %inc, 22403
263 br i1 %cmp, label %for.body, label %for.end
265 for.end: ; preds = %for.body, %entry
271 ; CHECK: test_pos16_ri_slt
274 define void @test_pos16_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
276 %cmp3 = icmp slt i32 %a, 21715
277 br i1 %cmp3, label %for.body.lr.ph, label %for.end
279 for.body.lr.ph: ; preds = %entry
282 for.body: ; preds = %for.body.lr.ph, %for.body
283 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
284 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
285 %0 = load i8, i8* %arrayidx, align 1
286 %conv = zext i8 %0 to i32
287 %add = add nsw i32 %conv, 1
288 %conv1 = trunc i32 %add to i8
289 store i8 %conv1, i8* %arrayidx, align 1
290 %inc = add nsw i32 %i.04, 16
291 %cmp = icmp slt i32 %inc, 21715
292 br i1 %cmp, label %for.body, label %for.end
294 for.end: ; preds = %for.body, %entry
300 ; CHECK: test_pos1_rr_slt
303 define void @test_pos1_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
305 %cmp3 = icmp slt i32 %a, %b
306 br i1 %cmp3, label %for.body.lr.ph, label %for.end
308 for.body.lr.ph: ; preds = %entry
311 for.body: ; preds = %for.body.lr.ph, %for.body
312 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
313 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
314 %0 = load i8, i8* %arrayidx, align 1
315 %conv = zext i8 %0 to i32
316 %add = add nsw i32 %conv, 1
317 %conv1 = trunc i32 %add to i8
318 store i8 %conv1, i8* %arrayidx, align 1
319 %inc = add nsw i32 %i.04, 1
320 %cmp = icmp slt i32 %inc, %b
321 br i1 %cmp, label %for.body, label %for.end
323 for.end: ; preds = %for.body, %entry
329 ; CHECK: test_pos2_rr_slt
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, 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 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
361 define void @test_pos4_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
363 %cmp3 = icmp slt i32 %a, %b
364 br i1 %cmp3, label %for.body.lr.ph, label %for.end
366 for.body.lr.ph: ; preds = %entry
369 for.body: ; preds = %for.body.lr.ph, %for.body
370 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
371 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
372 %0 = load i8, i8* %arrayidx, align 1
373 %conv = zext i8 %0 to i32
374 %add = add nsw i32 %conv, 1
375 %conv1 = trunc i32 %add to i8
376 store i8 %conv1, i8* %arrayidx, align 1
377 %inc = add nsw i32 %i.04, 4
378 %cmp = icmp slt i32 %inc, %b
379 br i1 %cmp, label %for.body, label %for.end
381 for.end: ; preds = %for.body, %entry
387 ; CHECK: test_pos8_rr_slt
390 define void @test_pos8_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
392 %cmp3 = icmp slt i32 %a, %b
393 br i1 %cmp3, label %for.body.lr.ph, label %for.end
395 for.body.lr.ph: ; preds = %entry
398 for.body: ; preds = %for.body.lr.ph, %for.body
399 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
400 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
401 %0 = load i8, i8* %arrayidx, align 1
402 %conv = zext i8 %0 to i32
403 %add = add nsw i32 %conv, 1
404 %conv1 = trunc i32 %add to i8
405 store i8 %conv1, i8* %arrayidx, align 1
406 %inc = add nsw i32 %i.04, 8
407 %cmp = icmp slt i32 %inc, %b
408 br i1 %cmp, label %for.body, label %for.end
410 for.end: ; preds = %for.body, %entry
416 ; CHECK: test_pos16_rr_slt
419 define void @test_pos16_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
421 %cmp3 = icmp slt 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, i8* %p, i32 %i.04
430 %0 = load i8, i8* %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, i8* %arrayidx, align 1
435 %inc = add nsw i32 %i.04, 16
436 %cmp = icmp slt i32 %inc, %b
437 br i1 %cmp, label %for.body, label %for.end
439 for.end: ; preds = %for.body, %entry