1 ; RUN: llc -march=hexagon -mcpu=hexagonv4 -O3 < %s | FileCheck %s
4 ; CHECK: test_pos1_ir_slt
7 define void @test_pos1_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
9 %cmp3 = icmp slt i32 8531, %b
10 br i1 %cmp3, label %for.body.lr.ph, label %for.end
12 for.body.lr.ph: ; preds = %entry
15 for.body: ; preds = %for.body.lr.ph, %for.body
16 %i.04 = phi i32 [ 8531, %for.body.lr.ph ], [ %inc, %for.body ]
17 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
18 %0 = load i8* %arrayidx, align 1
19 %conv = zext i8 %0 to i32
20 %add = add nsw i32 %conv, 1
21 %conv1 = trunc i32 %add to i8
22 store i8 %conv1, i8* %arrayidx, align 1
23 %inc = add nsw i32 %i.04, 1
24 %cmp = icmp slt i32 %inc, %b
25 br i1 %cmp, label %for.body, label %for.end
27 for.end: ; preds = %for.body, %entry
33 ; CHECK: test_pos2_ir_slt
36 define void @test_pos2_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
38 %cmp3 = icmp slt i32 9152, %b
39 br i1 %cmp3, label %for.body.lr.ph, label %for.end
41 for.body.lr.ph: ; preds = %entry
44 for.body: ; preds = %for.body.lr.ph, %for.body
45 %i.04 = phi i32 [ 9152, %for.body.lr.ph ], [ %inc, %for.body ]
46 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
47 %0 = load i8* %arrayidx, align 1
48 %conv = zext i8 %0 to i32
49 %add = add nsw i32 %conv, 1
50 %conv1 = trunc i32 %add to i8
51 store i8 %conv1, i8* %arrayidx, align 1
52 %inc = add nsw i32 %i.04, 2
53 %cmp = icmp slt i32 %inc, %b
54 br i1 %cmp, label %for.body, label %for.end
56 for.end: ; preds = %for.body, %entry
62 ; CHECK: test_pos4_ir_slt
65 define void @test_pos4_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
67 %cmp3 = icmp slt i32 18851, %b
68 br i1 %cmp3, label %for.body.lr.ph, label %for.end
70 for.body.lr.ph: ; preds = %entry
73 for.body: ; preds = %for.body.lr.ph, %for.body
74 %i.04 = phi i32 [ 18851, %for.body.lr.ph ], [ %inc, %for.body ]
75 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
76 %0 = load i8* %arrayidx, align 1
77 %conv = zext i8 %0 to i32
78 %add = add nsw i32 %conv, 1
79 %conv1 = trunc i32 %add to i8
80 store i8 %conv1, i8* %arrayidx, align 1
81 %inc = add nsw i32 %i.04, 4
82 %cmp = icmp slt i32 %inc, %b
83 br i1 %cmp, label %for.body, label %for.end
85 for.end: ; preds = %for.body, %entry
91 ; CHECK: test_pos8_ir_slt
94 define void @test_pos8_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
96 %cmp3 = icmp slt i32 25466, %b
97 br i1 %cmp3, label %for.body.lr.ph, label %for.end
99 for.body.lr.ph: ; preds = %entry
102 for.body: ; preds = %for.body.lr.ph, %for.body
103 %i.04 = phi i32 [ 25466, %for.body.lr.ph ], [ %inc, %for.body ]
104 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
105 %0 = load i8* %arrayidx, align 1
106 %conv = zext i8 %0 to i32
107 %add = add nsw i32 %conv, 1
108 %conv1 = trunc i32 %add to i8
109 store i8 %conv1, i8* %arrayidx, align 1
110 %inc = add nsw i32 %i.04, 8
111 %cmp = icmp slt i32 %inc, %b
112 br i1 %cmp, label %for.body, label %for.end
114 for.end: ; preds = %for.body, %entry
120 ; CHECK: test_pos16_ir_slt
123 define void @test_pos16_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
125 %cmp3 = icmp slt i32 9295, %b
126 br i1 %cmp3, label %for.body.lr.ph, label %for.end
128 for.body.lr.ph: ; preds = %entry
131 for.body: ; preds = %for.body.lr.ph, %for.body
132 %i.04 = phi i32 [ 9295, %for.body.lr.ph ], [ %inc, %for.body ]
133 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
134 %0 = load i8* %arrayidx, align 1
135 %conv = zext i8 %0 to i32
136 %add = add nsw i32 %conv, 1
137 %conv1 = trunc i32 %add to i8
138 store i8 %conv1, i8* %arrayidx, align 1
139 %inc = add nsw i32 %i.04, 16
140 %cmp = icmp slt i32 %inc, %b
141 br i1 %cmp, label %for.body, label %for.end
143 for.end: ; preds = %for.body, %entry
149 ; CHECK: test_pos1_ri_slt
152 define void @test_pos1_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
154 %cmp3 = icmp slt i32 %a, 31236
155 br i1 %cmp3, label %for.body.lr.ph, label %for.end
157 for.body.lr.ph: ; preds = %entry
160 for.body: ; preds = %for.body.lr.ph, %for.body
161 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
162 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
163 %0 = load i8* %arrayidx, align 1
164 %conv = zext i8 %0 to i32
165 %add = add nsw i32 %conv, 1
166 %conv1 = trunc i32 %add to i8
167 store i8 %conv1, i8* %arrayidx, align 1
168 %inc = add nsw i32 %i.04, 1
169 %cmp = icmp slt i32 %inc, 31236
170 br i1 %cmp, label %for.body, label %for.end
172 for.end: ; preds = %for.body, %entry
178 ; CHECK: test_pos2_ri_slt
181 define void @test_pos2_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
183 %cmp3 = icmp slt i32 %a, 22653
184 br i1 %cmp3, label %for.body.lr.ph, label %for.end
186 for.body.lr.ph: ; preds = %entry
189 for.body: ; preds = %for.body.lr.ph, %for.body
190 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
191 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
192 %0 = load i8* %arrayidx, align 1
193 %conv = zext i8 %0 to i32
194 %add = add nsw i32 %conv, 1
195 %conv1 = trunc i32 %add to i8
196 store i8 %conv1, i8* %arrayidx, align 1
197 %inc = add nsw i32 %i.04, 2
198 %cmp = icmp slt i32 %inc, 22653
199 br i1 %cmp, label %for.body, label %for.end
201 for.end: ; preds = %for.body, %entry
207 ; CHECK: test_pos4_ri_slt
210 define void @test_pos4_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
212 %cmp3 = icmp slt i32 %a, 1431
213 br i1 %cmp3, label %for.body.lr.ph, label %for.end
215 for.body.lr.ph: ; preds = %entry
218 for.body: ; preds = %for.body.lr.ph, %for.body
219 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
220 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
221 %0 = load i8* %arrayidx, align 1
222 %conv = zext i8 %0 to i32
223 %add = add nsw i32 %conv, 1
224 %conv1 = trunc i32 %add to i8
225 store i8 %conv1, i8* %arrayidx, align 1
226 %inc = add nsw i32 %i.04, 4
227 %cmp = icmp slt i32 %inc, 1431
228 br i1 %cmp, label %for.body, label %for.end
230 for.end: ; preds = %for.body, %entry
236 ; CHECK: test_pos8_ri_slt
239 define void @test_pos8_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
241 %cmp3 = icmp slt i32 %a, 22403
242 br i1 %cmp3, label %for.body.lr.ph, label %for.end
244 for.body.lr.ph: ; preds = %entry
247 for.body: ; preds = %for.body.lr.ph, %for.body
248 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
249 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
250 %0 = load i8* %arrayidx, align 1
251 %conv = zext i8 %0 to i32
252 %add = add nsw i32 %conv, 1
253 %conv1 = trunc i32 %add to i8
254 store i8 %conv1, i8* %arrayidx, align 1
255 %inc = add nsw i32 %i.04, 8
256 %cmp = icmp slt i32 %inc, 22403
257 br i1 %cmp, label %for.body, label %for.end
259 for.end: ; preds = %for.body, %entry
265 ; CHECK: test_pos16_ri_slt
268 define void @test_pos16_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
270 %cmp3 = icmp slt i32 %a, 21715
271 br i1 %cmp3, label %for.body.lr.ph, label %for.end
273 for.body.lr.ph: ; preds = %entry
276 for.body: ; preds = %for.body.lr.ph, %for.body
277 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
278 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
279 %0 = load i8* %arrayidx, align 1
280 %conv = zext i8 %0 to i32
281 %add = add nsw i32 %conv, 1
282 %conv1 = trunc i32 %add to i8
283 store i8 %conv1, i8* %arrayidx, align 1
284 %inc = add nsw i32 %i.04, 16
285 %cmp = icmp slt i32 %inc, 21715
286 br i1 %cmp, label %for.body, label %for.end
288 for.end: ; preds = %for.body, %entry
294 ; CHECK: test_pos1_rr_slt
297 define void @test_pos1_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
299 %cmp3 = icmp slt i32 %a, %b
300 br i1 %cmp3, label %for.body.lr.ph, label %for.end
302 for.body.lr.ph: ; preds = %entry
305 for.body: ; preds = %for.body.lr.ph, %for.body
306 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
307 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
308 %0 = load i8* %arrayidx, align 1
309 %conv = zext i8 %0 to i32
310 %add = add nsw i32 %conv, 1
311 %conv1 = trunc i32 %add to i8
312 store i8 %conv1, i8* %arrayidx, align 1
313 %inc = add nsw i32 %i.04, 1
314 %cmp = icmp slt i32 %inc, %b
315 br i1 %cmp, label %for.body, label %for.end
317 for.end: ; preds = %for.body, %entry
323 ; CHECK: test_pos2_rr_slt
326 define void @test_pos2_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
328 %cmp3 = icmp slt i32 %a, %b
329 br i1 %cmp3, label %for.body.lr.ph, label %for.end
331 for.body.lr.ph: ; preds = %entry
334 for.body: ; preds = %for.body.lr.ph, %for.body
335 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
336 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
337 %0 = load i8* %arrayidx, align 1
338 %conv = zext i8 %0 to i32
339 %add = add nsw i32 %conv, 1
340 %conv1 = trunc i32 %add to i8
341 store i8 %conv1, i8* %arrayidx, align 1
342 %inc = add nsw i32 %i.04, 2
343 %cmp = icmp slt i32 %inc, %b
344 br i1 %cmp, label %for.body, label %for.end
346 for.end: ; preds = %for.body, %entry
352 ; CHECK: test_pos4_rr_slt
355 define void @test_pos4_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
357 %cmp3 = icmp slt i32 %a, %b
358 br i1 %cmp3, label %for.body.lr.ph, label %for.end
360 for.body.lr.ph: ; preds = %entry
363 for.body: ; preds = %for.body.lr.ph, %for.body
364 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
365 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
366 %0 = load i8* %arrayidx, align 1
367 %conv = zext i8 %0 to i32
368 %add = add nsw i32 %conv, 1
369 %conv1 = trunc i32 %add to i8
370 store i8 %conv1, i8* %arrayidx, align 1
371 %inc = add nsw i32 %i.04, 4
372 %cmp = icmp slt i32 %inc, %b
373 br i1 %cmp, label %for.body, label %for.end
375 for.end: ; preds = %for.body, %entry
381 ; CHECK: test_pos8_rr_slt
384 define void @test_pos8_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
386 %cmp3 = icmp slt i32 %a, %b
387 br i1 %cmp3, label %for.body.lr.ph, label %for.end
389 for.body.lr.ph: ; preds = %entry
392 for.body: ; preds = %for.body.lr.ph, %for.body
393 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
394 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
395 %0 = load i8* %arrayidx, align 1
396 %conv = zext i8 %0 to i32
397 %add = add nsw i32 %conv, 1
398 %conv1 = trunc i32 %add to i8
399 store i8 %conv1, i8* %arrayidx, align 1
400 %inc = add nsw i32 %i.04, 8
401 %cmp = icmp slt i32 %inc, %b
402 br i1 %cmp, label %for.body, label %for.end
404 for.end: ; preds = %for.body, %entry
410 ; CHECK: test_pos16_rr_slt
413 define void @test_pos16_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
415 %cmp3 = icmp slt i32 %a, %b
416 br i1 %cmp3, label %for.body.lr.ph, label %for.end
418 for.body.lr.ph: ; preds = %entry
421 for.body: ; preds = %for.body.lr.ph, %for.body
422 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
423 %arrayidx = getelementptr inbounds i8* %p, i32 %i.04
424 %0 = load i8* %arrayidx, align 1
425 %conv = zext i8 %0 to i32
426 %add = add nsw i32 %conv, 1
427 %conv1 = trunc i32 %add to i8
428 store i8 %conv1, i8* %arrayidx, align 1
429 %inc = add nsw i32 %i.04, 16
430 %cmp = icmp slt i32 %inc, %b
431 br i1 %cmp, label %for.body, label %for.end
433 for.end: ; preds = %for.body, %entry