1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt < %s -S -passes=loop-unroll -unroll-peel-max-count=3 | FileCheck %s
7 define void @test_umin(i32 %N) {
8 ; CHECK-LABEL: define void @test_umin(
9 ; CHECK-SAME: i32 [[N:%.*]]) {
11 ; CHECK-NEXT: [[CMP5_NOT:%.*]] = icmp eq i32 [[N]], 0
12 ; CHECK-NEXT: br i1 [[CMP5_NOT]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
13 ; CHECK: for.body.preheader:
14 ; CHECK-NEXT: br label [[FOR_BODY_PEEL2:%.*]]
15 ; CHECK: for.body.peel.begin:
16 ; CHECK-NEXT: br label [[FOR_BODY_PEEL:%.*]]
17 ; CHECK: for.body.peel:
18 ; CHECK-NEXT: [[COND_PEEL:%.*]] = tail call i32 @llvm.umin.i32(i32 0, i32 2)
19 ; CHECK-NEXT: tail call void @foo(i32 [[COND_PEEL]])
20 ; CHECK-NEXT: [[INC_PEEL:%.*]] = add nuw i32 0, 1
21 ; CHECK-NEXT: [[EXITCOND_NOT_PEEL:%.*]] = icmp eq i32 [[INC_PEEL]], [[N]]
22 ; CHECK-NEXT: br i1 [[EXITCOND_NOT_PEEL]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]], label [[FOR_BODY_PEEL_NEXT:%.*]]
23 ; CHECK: for.body.peel.next:
24 ; CHECK-NEXT: br label [[FOR_BODY_PEEL3:%.*]]
25 ; CHECK: for.body.peel2:
26 ; CHECK-NEXT: [[COND_PEEL3:%.*]] = tail call i32 @llvm.umin.i32(i32 [[INC_PEEL]], i32 2)
27 ; CHECK-NEXT: tail call void @foo(i32 [[COND_PEEL3]])
28 ; CHECK-NEXT: [[INC_PEEL4:%.*]] = add nuw i32 [[INC_PEEL]], 1
29 ; CHECK-NEXT: [[EXITCOND_NOT_PEEL5:%.*]] = icmp eq i32 [[INC_PEEL4]], [[N]]
30 ; CHECK-NEXT: br i1 [[EXITCOND_NOT_PEEL5]], label [[FOR_COND_CLEANUP_LOOPEXIT]], label [[FOR_BODY_PEEL_NEXT1:%.*]]
31 ; CHECK: for.body.peel.next1:
32 ; CHECK-NEXT: br label [[FOR_BODY_PEEL_NEXT6:%.*]]
33 ; CHECK: for.body.peel.next6:
34 ; CHECK-NEXT: br label [[FOR_BODY_PREHEADER_PEEL_NEWPH:%.*]]
35 ; CHECK: for.body.preheader.peel.newph:
36 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
38 ; CHECK-NEXT: [[I_06:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ [[INC_PEEL4]], [[FOR_BODY_PREHEADER_PEEL_NEWPH]] ]
39 ; CHECK-NEXT: tail call void @foo(i32 2)
40 ; CHECK-NEXT: [[INC]] = add nuw i32 [[I_06]], 1
41 ; CHECK-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC]], [[N]]
42 ; CHECK-NEXT: br i1 [[EXITCOND_NOT]], label [[FOR_COND_CLEANUP_LOOPEXIT_LOOPEXIT:%.*]], label [[FOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]
43 ; CHECK: for.cond.cleanup.loopexit.loopexit:
44 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP_LOOPEXIT]]
45 ; CHECK: for.cond.cleanup.loopexit:
46 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
47 ; CHECK: for.cond.cleanup:
48 ; CHECK-NEXT: ret void
51 %cmp5.not = icmp eq i32 %N, 0
52 br i1 %cmp5.not, label %for.cond.cleanup, label %for.body
55 %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
56 %cond = tail call i32 @llvm.umin.i32(i32 %i.06, i32 2)
57 tail call void @foo(i32 %cond)
58 %inc = add nuw i32 %i.06, 1
59 %exitcond.not = icmp eq i32 %inc, %N
60 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
66 define void @test_umax(i32 %N) {
67 ; CHECK-LABEL: define void @test_umax(
68 ; CHECK-SAME: i32 [[N:%.*]]) {
70 ; CHECK-NEXT: [[CMP5_NOT:%.*]] = icmp eq i32 [[N]], 0
71 ; CHECK-NEXT: br i1 [[CMP5_NOT]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
72 ; CHECK: for.body.preheader:
73 ; CHECK-NEXT: br label [[FOR_BODY_PEEL2:%.*]]
74 ; CHECK: for.body.peel.begin:
75 ; CHECK-NEXT: br label [[FOR_BODY_PEEL:%.*]]
76 ; CHECK: for.body.peel:
77 ; CHECK-NEXT: [[COND_PEEL:%.*]] = tail call i32 @llvm.umax.i32(i32 0, i32 2)
78 ; CHECK-NEXT: tail call void @foo(i32 [[COND_PEEL]])
79 ; CHECK-NEXT: [[INC_PEEL:%.*]] = add nuw i32 0, 1
80 ; CHECK-NEXT: [[EXITCOND_NOT_PEEL:%.*]] = icmp eq i32 [[INC_PEEL]], [[N]]
81 ; CHECK-NEXT: br i1 [[EXITCOND_NOT_PEEL]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]], label [[FOR_BODY_PEEL_NEXT:%.*]]
82 ; CHECK: for.body.peel.next:
83 ; CHECK-NEXT: br label [[FOR_BODY_PEEL3:%.*]]
84 ; CHECK: for.body.peel2:
85 ; CHECK-NEXT: [[COND_PEEL3:%.*]] = tail call i32 @llvm.umax.i32(i32 [[INC_PEEL]], i32 2)
86 ; CHECK-NEXT: tail call void @foo(i32 [[COND_PEEL3]])
87 ; CHECK-NEXT: [[INC_PEEL4:%.*]] = add nuw i32 [[INC_PEEL]], 1
88 ; CHECK-NEXT: [[EXITCOND_NOT_PEEL5:%.*]] = icmp eq i32 [[INC_PEEL4]], [[N]]
89 ; CHECK-NEXT: br i1 [[EXITCOND_NOT_PEEL5]], label [[FOR_COND_CLEANUP_LOOPEXIT]], label [[FOR_BODY_PEEL_NEXT1:%.*]]
90 ; CHECK: for.body.peel.next1:
91 ; CHECK-NEXT: br label [[FOR_BODY_PEEL_NEXT6:%.*]]
92 ; CHECK: for.body.peel.next6:
93 ; CHECK-NEXT: br label [[FOR_BODY_PREHEADER_PEEL_NEWPH:%.*]]
94 ; CHECK: for.body.preheader.peel.newph:
95 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
97 ; CHECK-NEXT: [[I_06:%.*]] = phi i32 [ [[INC:%.*]], [[FOR_BODY]] ], [ [[INC_PEEL4]], [[FOR_BODY_PREHEADER_PEEL_NEWPH]] ]
98 ; CHECK-NEXT: tail call void @foo(i32 [[I_06]])
99 ; CHECK-NEXT: [[INC]] = add nuw i32 [[I_06]], 1
100 ; CHECK-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC]], [[N]]
101 ; CHECK-NEXT: br i1 [[EXITCOND_NOT]], label [[FOR_COND_CLEANUP_LOOPEXIT_LOOPEXIT:%.*]], label [[FOR_BODY]], !llvm.loop [[LOOP2:![0-9]+]]
102 ; CHECK: for.cond.cleanup.loopexit.loopexit:
103 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP_LOOPEXIT]]
104 ; CHECK: for.cond.cleanup.loopexit:
105 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
106 ; CHECK: for.cond.cleanup:
107 ; CHECK-NEXT: ret void
110 %cmp5.not = icmp eq i32 %N, 0
111 br i1 %cmp5.not, label %for.cond.cleanup, label %for.body
114 %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
115 %cond = tail call i32 @llvm.umax.i32(i32 %i.06, i32 2)
116 tail call void @foo(i32 %cond)
117 %inc = add nuw i32 %i.06, 1
118 %exitcond.not = icmp eq i32 %inc, %N
119 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
125 define void @test_smax(i32 %N) {
126 ; CHECK-LABEL: define void @test_smax(
127 ; CHECK-SAME: i32 [[N:%.*]]) {
129 ; CHECK-NEXT: [[CMP5:%.*]] = icmp slt i32 [[N]], 0
130 ; CHECK-NEXT: br i1 [[CMP5]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]
131 ; CHECK: for.body.preheader:
132 ; CHECK-NEXT: br label [[FOR_BODY_PEEL2:%.*]]
133 ; CHECK: for.body.peel.begin:
134 ; CHECK-NEXT: br label [[FOR_BODY_PEEL:%.*]]
135 ; CHECK: for.body.peel:
136 ; CHECK-NEXT: [[COND_PEEL:%.*]] = tail call i32 @llvm.smax.i32(i32 0, i32 -2)
137 ; CHECK-NEXT: tail call void @foo(i32 [[COND_PEEL]])
138 ; CHECK-NEXT: [[DEC_PEEL:%.*]] = add nsw i32 0, -1
139 ; CHECK-NEXT: [[CMP_PEEL:%.*]] = icmp sgt i32 [[DEC_PEEL]], [[N]]
140 ; CHECK-NEXT: br i1 [[CMP_PEEL]], label [[FOR_BODY_PEEL_NEXT:%.*]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]]
141 ; CHECK: for.body.peel.next:
142 ; CHECK-NEXT: br label [[FOR_BODY_PEEL3:%.*]]
143 ; CHECK: for.body.peel2:
144 ; CHECK-NEXT: [[COND_PEEL3:%.*]] = tail call i32 @llvm.smax.i32(i32 [[DEC_PEEL]], i32 -2)
145 ; CHECK-NEXT: tail call void @foo(i32 [[COND_PEEL3]])
146 ; CHECK-NEXT: [[DEC_PEEL4:%.*]] = add nsw i32 [[DEC_PEEL]], -1
147 ; CHECK-NEXT: [[CMP_PEEL5:%.*]] = icmp sgt i32 [[DEC_PEEL4]], [[N]]
148 ; CHECK-NEXT: br i1 [[CMP_PEEL5]], label [[FOR_BODY_PEEL_NEXT1:%.*]], label [[FOR_COND_CLEANUP_LOOPEXIT]]
149 ; CHECK: for.body.peel.next1:
150 ; CHECK-NEXT: br label [[FOR_BODY_PEEL_NEXT6:%.*]]
151 ; CHECK: for.body.peel.next6:
152 ; CHECK-NEXT: br label [[FOR_BODY_PREHEADER_PEEL_NEWPH:%.*]]
153 ; CHECK: for.body.preheader.peel.newph:
154 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
156 ; CHECK-NEXT: [[I_06:%.*]] = phi i32 [ [[DEC:%.*]], [[FOR_BODY]] ], [ [[DEC_PEEL4]], [[FOR_BODY_PREHEADER_PEEL_NEWPH]] ]
157 ; CHECK-NEXT: tail call void @foo(i32 -2)
158 ; CHECK-NEXT: [[DEC]] = add nsw i32 [[I_06]], -1
159 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[DEC]], [[N]]
160 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP_LOOPEXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP3:![0-9]+]]
161 ; CHECK: for.cond.cleanup.loopexit.loopexit:
162 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP_LOOPEXIT]]
163 ; CHECK: for.cond.cleanup.loopexit:
164 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
165 ; CHECK: for.cond.cleanup:
166 ; CHECK-NEXT: ret void
169 %cmp5 = icmp slt i32 %N, 0
170 br i1 %cmp5, label %for.body, label %for.cond.cleanup
173 %i.06 = phi i32 [ %dec, %for.body ], [ 0, %entry ]
174 %cond = tail call i32 @llvm.smax.i32(i32 %i.06, i32 -2)
175 tail call void @foo(i32 %cond)
176 %dec = add nsw i32 %i.06, -1
177 %cmp = icmp sgt i32 %dec, %N
178 br i1 %cmp, label %for.body, label %for.cond.cleanup
184 define void @test_smin(i32 %N) {
185 ; CHECK-LABEL: define void @test_smin(
186 ; CHECK-SAME: i32 [[N:%.*]]) {
188 ; CHECK-NEXT: [[CMP5:%.*]] = icmp slt i32 [[N]], 0
189 ; CHECK-NEXT: br i1 [[CMP5]], label [[FOR_BODY_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]
190 ; CHECK: for.body.preheader:
191 ; CHECK-NEXT: br label [[FOR_BODY_PEEL2:%.*]]
192 ; CHECK: for.body.peel.begin:
193 ; CHECK-NEXT: br label [[FOR_BODY_PEEL:%.*]]
194 ; CHECK: for.body.peel:
195 ; CHECK-NEXT: [[COND_PEEL:%.*]] = tail call i32 @llvm.smin.i32(i32 0, i32 -2)
196 ; CHECK-NEXT: tail call void @foo(i32 noundef signext [[COND_PEEL]])
197 ; CHECK-NEXT: [[DEC_PEEL:%.*]] = add nsw i32 0, -1
198 ; CHECK-NEXT: [[CMP_PEEL:%.*]] = icmp sgt i32 [[DEC_PEEL]], [[N]]
199 ; CHECK-NEXT: br i1 [[CMP_PEEL]], label [[FOR_BODY_PEEL_NEXT:%.*]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]]
200 ; CHECK: for.body.peel.next:
201 ; CHECK-NEXT: br label [[FOR_BODY_PEEL3:%.*]]
202 ; CHECK: for.body.peel2:
203 ; CHECK-NEXT: [[COND_PEEL3:%.*]] = tail call i32 @llvm.smin.i32(i32 [[DEC_PEEL]], i32 -2)
204 ; CHECK-NEXT: tail call void @foo(i32 noundef signext [[COND_PEEL3]])
205 ; CHECK-NEXT: [[DEC_PEEL4:%.*]] = add nsw i32 [[DEC_PEEL]], -1
206 ; CHECK-NEXT: [[CMP_PEEL5:%.*]] = icmp sgt i32 [[DEC_PEEL4]], [[N]]
207 ; CHECK-NEXT: br i1 [[CMP_PEEL5]], label [[FOR_BODY_PEEL_NEXT1:%.*]], label [[FOR_COND_CLEANUP_LOOPEXIT]]
208 ; CHECK: for.body.peel.next1:
209 ; CHECK-NEXT: br label [[FOR_BODY_PEEL_NEXT6:%.*]]
210 ; CHECK: for.body.peel.next6:
211 ; CHECK-NEXT: br label [[FOR_BODY_PREHEADER_PEEL_NEWPH:%.*]]
212 ; CHECK: for.body.preheader.peel.newph:
213 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
215 ; CHECK-NEXT: [[I_06:%.*]] = phi i32 [ [[DEC:%.*]], [[FOR_BODY]] ], [ [[DEC_PEEL4]], [[FOR_BODY_PREHEADER_PEEL_NEWPH]] ]
216 ; CHECK-NEXT: tail call void @foo(i32 noundef signext [[I_06]])
217 ; CHECK-NEXT: [[DEC]] = add nsw i32 [[I_06]], -1
218 ; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[DEC]], [[N]]
219 ; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP_LOOPEXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP4:![0-9]+]]
220 ; CHECK: for.cond.cleanup.loopexit.loopexit:
221 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP_LOOPEXIT]]
222 ; CHECK: for.cond.cleanup.loopexit:
223 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
224 ; CHECK: for.cond.cleanup:
225 ; CHECK-NEXT: ret void
228 %cmp5 = icmp slt i32 %N, 0
229 br i1 %cmp5, label %for.body, label %for.cond.cleanup
232 %i.06 = phi i32 [ %dec, %for.body ], [ 0, %entry ]
233 %cond = tail call i32 @llvm.smin.i32(i32 %i.06, i32 -2)
234 tail call void @foo(i32 noundef signext %cond)
235 %dec = add nsw i32 %i.06, -1
236 %cmp = icmp sgt i32 %dec, %N
237 br i1 %cmp, label %for.body, label %for.cond.cleanup
243 define void @test_negative(i32 %End, i32 %Step) {
244 ; CHECK-LABEL: define void @test_negative(
245 ; CHECK-SAME: i32 [[END:%.*]], i32 [[STEP:%.*]]) {
247 ; CHECK-NEXT: [[CMP_NOT5:%.*]] = icmp eq i32 [[END]], 0
248 ; CHECK-NEXT: br i1 [[CMP_NOT5]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
249 ; CHECK: for.body.preheader:
250 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
252 ; CHECK-NEXT: [[I_06:%.*]] = phi i32 [ [[ADD:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
253 ; CHECK-NEXT: [[COND:%.*]] = tail call i32 @llvm.smin.i32(i32 [[I_06]], i32 2)
254 ; CHECK-NEXT: tail call void @foo(i32 [[COND]])
255 ; CHECK-NEXT: [[ADD]] = add nsw i32 [[I_06]], [[STEP]]
256 ; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq i32 [[ADD]], [[END]]
257 ; CHECK-NEXT: br i1 [[CMP_NOT]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]], label [[FOR_BODY]]
258 ; CHECK: for.cond.cleanup.loopexit:
259 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
260 ; CHECK: for.cond.cleanup:
261 ; CHECK-NEXT: ret void
264 %cmp.not5 = icmp eq i32 %End, 0
265 br i1 %cmp.not5, label %for.cond.cleanup, label %for.body
268 %i.06 = phi i32 [ %add, %for.body ], [ 0, %entry ]
269 %cond = tail call i32 @llvm.smin.i32(i32 %i.06, i32 2)
270 tail call void @foo(i32 %cond)
271 %add = add nsw i32 %i.06, %Step
272 %cmp.not = icmp eq i32 %add, %End
273 br i1 %cmp.not, label %for.cond.cleanup, label %for.body
279 define void @test_max_count_threshold(i32 %N) {
280 ; CHECK-LABEL: define void @test_max_count_threshold(
281 ; CHECK-SAME: i32 [[N:%.*]]) {
283 ; CHECK-NEXT: [[CMP5_NOT:%.*]] = icmp eq i32 [[N]], 0
284 ; CHECK-NEXT: br i1 [[CMP5_NOT]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
285 ; CHECK: for.body.preheader:
286 ; CHECK-NEXT: br label [[FOR_BODY1:%.*]]
288 ; CHECK-NEXT: [[I_6:%.*]] = phi i32 [ [[INC1:%.*]], [[FOR_BODY1]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
289 ; CHECK-NEXT: [[COND1:%.*]] = tail call i32 @llvm.umin.i32(i32 [[I_6]], i32 5)
290 ; CHECK-NEXT: tail call void @foo(i32 [[COND1]])
291 ; CHECK-NEXT: [[INC1]] = add nuw i32 [[I_6]], 1
292 ; CHECK-NEXT: [[EXITCOND_NOT1:%.*]] = icmp eq i32 [[INC1]], [[N]]
293 ; CHECK-NEXT: br i1 [[EXITCOND_NOT1]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]], label [[FOR_BODY1]]
294 ; CHECK: for.cond.cleanup.loopexit:
295 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
296 ; CHECK: for.cond.cleanup:
297 ; CHECK-NEXT: ret void
300 %cmp5.not = icmp eq i32 %N, 0
301 br i1 %cmp5.not, label %for.cond.cleanup, label %for.body
304 %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
305 %cond = tail call i32 @llvm.umin.i32(i32 %i.06, i32 5)
306 tail call void @foo(i32 %cond)
307 %inc = add nuw i32 %i.06, 1
308 %exitcond.not = icmp eq i32 %inc, %N
309 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
315 define void @test_wrap(i8 %N) {
316 ; CHECK-LABEL: define void @test_wrap(
317 ; CHECK-SAME: i8 [[N:%.*]]) {
319 ; CHECK-NEXT: [[CMP5_NOT:%.*]] = icmp eq i8 [[N]], 0
320 ; CHECK-NEXT: br i1 [[CMP5_NOT]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
321 ; CHECK: for.body.preheader:
322 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
324 ; CHECK-NEXT: [[I_06:%.*]] = phi i8 [ [[INC:%.*]], [[FOR_BODY]] ], [ 0, [[FOR_BODY_PREHEADER]] ]
325 ; CHECK-NEXT: [[COND:%.*]] = tail call i8 @llvm.umin.i8(i8 [[I_06]], i8 -2)
326 ; CHECK-NEXT: tail call void @bar(i8 [[COND]])
327 ; CHECK-NEXT: [[INC]] = add i8 [[I_06]], 127
328 ; CHECK-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i8 [[INC]], [[N]]
329 ; CHECK-NEXT: br i1 [[EXITCOND_NOT]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]], label [[FOR_BODY]]
330 ; CHECK: for.cond.cleanup.loopexit:
331 ; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
332 ; CHECK: for.cond.cleanup:
333 ; CHECK-NEXT: ret void
336 %cmp5.not = icmp eq i8 %N, 0
337 br i1 %cmp5.not, label %for.cond.cleanup, label %for.body
340 %i.06 = phi i8 [ %inc, %for.body ], [ 0, %entry ]
341 %cond = tail call i8 @llvm.umin.i8(i8 %i.06, i8 254)
342 tail call void @bar(i8 %cond)
343 %inc = add i8 %i.06, 127
344 %exitcond.not = icmp eq i8 %inc, %N
345 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
351 ; CHECK: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]]}
352 ; CHECK: [[META1]] = !{!"llvm.loop.peeled.count", i32 2}
353 ; CHECK: [[LOOP2]] = distinct !{[[LOOP2]], [[META1]]}
354 ; CHECK: [[LOOP3]] = distinct !{[[LOOP3]], [[META1]]}
355 ; CHECK: [[LOOP4]] = distinct !{[[LOOP4]], [[META1]]}