1 ; RUN: llc -march=hexagon -O3 < %s | FileCheck %s
3 ; CHECK-LABEL: @test_pos1_ir_slt
6 define void @test_pos1_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
8 %cmp3 = icmp slt i32 8531, %b
9 br i1 %cmp3, label %for.body.lr.ph, label %for.end
15 %i.04 = phi i32 [ 8531, %for.body.lr.ph ], [ %inc, %for.body ]
16 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
17 %0 = load i8, i8* %arrayidx, align 1
18 %conv = zext i8 %0 to i32
19 %add = add nsw i32 %conv, 1
20 %conv1 = trunc i32 %add to i8
21 store i8 %conv1, i8* %arrayidx, align 1
22 %inc = add nsw i32 %i.04, 1
23 %cmp = icmp slt i32 %inc, %b
24 br i1 %cmp, label %for.body, label %for.end
30 ; CHECK-LABEL: @test_pos2_ir_slt
33 define void @test_pos2_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
35 %cmp3 = icmp slt i32 9152, %b
36 br i1 %cmp3, label %for.body.lr.ph, label %for.end
42 %i.04 = phi i32 [ 9152, %for.body.lr.ph ], [ %inc, %for.body ]
43 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
44 %0 = load i8, i8* %arrayidx, align 1
45 %conv = zext i8 %0 to i32
46 %add = add nsw i32 %conv, 1
47 %conv1 = trunc i32 %add to i8
48 store i8 %conv1, i8* %arrayidx, align 1
49 %inc = add nsw i32 %i.04, 2
50 %cmp = icmp slt i32 %inc, %b
51 br i1 %cmp, label %for.body, label %for.end
57 ; CHECK-LABEL: @test_pos4_ir_slt
60 define void @test_pos4_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
62 %cmp3 = icmp slt i32 18851, %b
63 br i1 %cmp3, label %for.body.lr.ph, label %for.end
69 %i.04 = phi i32 [ 18851, %for.body.lr.ph ], [ %inc, %for.body ]
70 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
71 %0 = load i8, i8* %arrayidx, align 1
72 %conv = zext i8 %0 to i32
73 %add = add nsw i32 %conv, 1
74 %conv1 = trunc i32 %add to i8
75 store i8 %conv1, i8* %arrayidx, align 1
76 %inc = add nsw i32 %i.04, 4
77 %cmp = icmp slt i32 %inc, %b
78 br i1 %cmp, label %for.body, label %for.end
84 ; CHECK-LABEL: @test_pos8_ir_slt
87 define void @test_pos8_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
89 %cmp3 = icmp slt i32 25466, %b
90 br i1 %cmp3, label %for.body.lr.ph, label %for.end
96 %i.04 = phi i32 [ 25466, %for.body.lr.ph ], [ %inc, %for.body ]
97 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
98 %0 = load i8, i8* %arrayidx, align 1
99 %conv = zext i8 %0 to i32
100 %add = add nsw i32 %conv, 1
101 %conv1 = trunc i32 %add to i8
102 store i8 %conv1, i8* %arrayidx, align 1
103 %inc = add nsw i32 %i.04, 8
104 %cmp = icmp slt i32 %inc, %b
105 br i1 %cmp, label %for.body, label %for.end
111 ; CHECK-LABEL: @test_pos16_ir_slt
114 define void @test_pos16_ir_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
116 %cmp3 = icmp slt i32 9295, %b
117 br i1 %cmp3, label %for.body.lr.ph, label %for.end
123 %i.04 = phi i32 [ 9295, %for.body.lr.ph ], [ %inc, %for.body ]
124 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
125 %0 = load i8, i8* %arrayidx, align 1
126 %conv = zext i8 %0 to i32
127 %add = add nsw i32 %conv, 1
128 %conv1 = trunc i32 %add to i8
129 store i8 %conv1, i8* %arrayidx, align 1
130 %inc = add nsw i32 %i.04, 16
131 %cmp = icmp slt i32 %inc, %b
132 br i1 %cmp, label %for.body, label %for.end
138 ; CHECK-LABEL: @test_pos1_ri_slt
141 define void @test_pos1_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
143 %cmp3 = icmp slt i32 %a, 31236
144 br i1 %cmp3, label %for.body.lr.ph, label %for.end
150 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
151 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
152 %0 = load i8, i8* %arrayidx, align 1
153 %conv = zext i8 %0 to i32
154 %add = add nsw i32 %conv, 1
155 %conv1 = trunc i32 %add to i8
156 store i8 %conv1, i8* %arrayidx, align 1
157 %inc = add nsw i32 %i.04, 1
158 %cmp = icmp slt i32 %inc, 31236
159 br i1 %cmp, label %for.body, label %for.end
165 ; CHECK-LABEL: @test_pos2_ri_slt
168 define void @test_pos2_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
170 %cmp3 = icmp slt i32 %a, 22653
171 br i1 %cmp3, label %for.body.lr.ph, label %for.end
177 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
178 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
179 %0 = load i8, i8* %arrayidx, align 1
180 %conv = zext i8 %0 to i32
181 %add = add nsw i32 %conv, 1
182 %conv1 = trunc i32 %add to i8
183 store i8 %conv1, i8* %arrayidx, align 1
184 %inc = add nsw i32 %i.04, 2
185 %cmp = icmp slt i32 %inc, 22653
186 br i1 %cmp, label %for.body, label %for.end
192 ; CHECK-LABEL: @test_pos4_ri_slt
195 define void @test_pos4_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
197 %cmp3 = icmp slt i32 %a, 1431
198 br i1 %cmp3, label %for.body.lr.ph, label %for.end
204 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
205 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
206 %0 = load i8, i8* %arrayidx, align 1
207 %conv = zext i8 %0 to i32
208 %add = add nsw i32 %conv, 1
209 %conv1 = trunc i32 %add to i8
210 store i8 %conv1, i8* %arrayidx, align 1
211 %inc = add nsw i32 %i.04, 4
212 %cmp = icmp slt i32 %inc, 1431
213 br i1 %cmp, label %for.body, label %for.end
219 ; CHECK-LABEL: @test_pos8_ri_slt
222 define void @test_pos8_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
224 %cmp3 = icmp slt i32 %a, 22403
225 br i1 %cmp3, label %for.body.lr.ph, label %for.end
231 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
232 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
233 %0 = load i8, i8* %arrayidx, align 1
234 %conv = zext i8 %0 to i32
235 %add = add nsw i32 %conv, 1
236 %conv1 = trunc i32 %add to i8
237 store i8 %conv1, i8* %arrayidx, align 1
238 %inc = add nsw i32 %i.04, 8
239 %cmp = icmp slt i32 %inc, 22403
240 br i1 %cmp, label %for.body, label %for.end
246 ; CHECK-LABEL: @test_pos16_ri_slt
249 define void @test_pos16_ri_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
251 %cmp3 = icmp slt i32 %a, 21715
252 br i1 %cmp3, label %for.body.lr.ph, label %for.end
258 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
259 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
260 %0 = load i8, i8* %arrayidx, align 1
261 %conv = zext i8 %0 to i32
262 %add = add nsw i32 %conv, 1
263 %conv1 = trunc i32 %add to i8
264 store i8 %conv1, i8* %arrayidx, align 1
265 %inc = add nsw i32 %i.04, 16
266 %cmp = icmp slt i32 %inc, 21715
267 br i1 %cmp, label %for.body, label %for.end
273 ; CHECK-LABEL: @test_pos1_rr_slt
276 define void @test_pos1_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
278 %cmp3 = icmp slt i32 %a, %b
279 br i1 %cmp3, label %for.body.lr.ph, label %for.end
285 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
286 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
287 %0 = load i8, i8* %arrayidx, align 1
288 %conv = zext i8 %0 to i32
289 %add = add nsw i32 %conv, 1
290 %conv1 = trunc i32 %add to i8
291 store i8 %conv1, i8* %arrayidx, align 1
292 %inc = add nsw i32 %i.04, 1
293 %cmp = icmp slt i32 %inc, %b
294 br i1 %cmp, label %for.body, label %for.end
300 ; CHECK-LABEL: @test_pos2_rr_slt
303 define void @test_pos2_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
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, 2
320 %cmp = icmp slt i32 %inc, %b
321 br i1 %cmp, label %for.body, label %for.end
327 ; CHECK-LABEL: @test_pos4_rr_slt
330 define void @test_pos4_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
332 %cmp3 = icmp slt i32 %a, %b
333 br i1 %cmp3, label %for.body.lr.ph, label %for.end
339 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
340 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
341 %0 = load i8, i8* %arrayidx, align 1
342 %conv = zext i8 %0 to i32
343 %add = add nsw i32 %conv, 1
344 %conv1 = trunc i32 %add to i8
345 store i8 %conv1, i8* %arrayidx, align 1
346 %inc = add nsw i32 %i.04, 4
347 %cmp = icmp slt i32 %inc, %b
348 br i1 %cmp, label %for.body, label %for.end
354 ; CHECK-LABEL: @test_pos8_rr_slt
357 define void @test_pos8_rr_slt(i8* nocapture %p, i32 %a, i32 %b) nounwind {
359 %cmp3 = icmp slt i32 %a, %b
360 br i1 %cmp3, label %for.body.lr.ph, label %for.end
366 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
367 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
368 %0 = load i8, i8* %arrayidx, align 1
369 %conv = zext i8 %0 to i32
370 %add = add nsw i32 %conv, 1
371 %conv1 = trunc i32 %add to i8
372 store i8 %conv1, i8* %arrayidx, align 1
373 %inc = add nsw i32 %i.04, 8
374 %cmp = icmp slt i32 %inc, %b
375 br i1 %cmp, label %for.body, label %for.end
381 ; CHECK-LABEL: @test_pos16_rr_slt
384 define void @test_pos16_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
393 %i.04 = phi i32 [ %a, %for.body.lr.ph ], [ %inc, %for.body ]
394 %arrayidx = getelementptr inbounds i8, i8* %p, i32 %i.04
395 %0 = load i8, 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, 16
401 %cmp = icmp slt i32 %inc, %b
402 br i1 %cmp, label %for.body, label %for.end