Lines Matching refs:index
8 func private @body(index) -> ()
12 // CHECK-NEXT: %[[c1:.*]] = constant 1 : index
13 // CHECK-NEXT: %[[c42:.*]] = constant 42 : index
14 // CHECK-NEXT: %[[c1_0:.*]] = constant 1 : index
16 // CHECK-NEXT: call @body(%{{.*}}) : (index) -> ()
22 call @body(%i) : (index) -> ()
29 func private @pre(index) -> ()
30 func private @body2(index, index) -> ()
31 func private @post(index) -> ()
34 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
35 // CHECK-NEXT: %[[c42:.*]] = constant 42 : index
36 // CHECK-NEXT: %[[c1:.*]] = constant 1 : index
38 // CHECK-NEXT: call @pre(%{{.*}}) : (index) -> ()
39 // CHECK-NEXT: %[[c7:.*]] = constant 7 : index
40 // CHECK-NEXT: %[[c56:.*]] = constant 56 : index
41 // CHECK-NEXT: %[[c2:.*]] = constant 2 : index
43 // CHECK-NEXT: call @body2(%{{.*}}, %{{.*}}) : (index, index) -> ()
45 // CHECK-NEXT: call @post(%{{.*}}) : (index) -> ()
51 call @pre(%i) : (index) -> ()
53 call @body2(%i, %j) : (index, index) -> ()
55 call @post(%i) : (index) -> ()
62 func private @mid(index) -> ()
63 func private @body3(index, index) -> ()
66 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
67 // CHECK-NEXT: %[[c42:.*]] = constant 42 : index
68 // CHECK-NEXT: %[[c1:.*]] = constant 1 : index
70 // CHECK-NEXT: call @pre(%{{.*}}) : (index) -> ()
71 // CHECK-NEXT: %[[c7:.*]] = constant 7 : index
72 // CHECK-NEXT: %[[c56:.*]] = constant 56 : index
73 // CHECK-NEXT: %[[c2:.*]] = constant 2 : index
75 // CHECK-NEXT: call @body2(%{{.*}}, %{{.*}}) : (index, index) -> ()
77 // CHECK-NEXT: call @mid(%{{.*}}) : (index) -> ()
78 // CHECK-NEXT: %[[c18:.*]] = constant 18 : index
79 // CHECK-NEXT: %[[c37:.*]] = constant 37 : index
80 // CHECK-NEXT: %[[c3:.*]] = constant 3 : index
82 // CHECK-NEXT: call @body3(%{{.*}}, %{{.*}}) : (index, index) -> ()
84 // CHECK-NEXT: call @post(%{{.*}}) : (index) -> ()
90 call @pre(%i) : (index) -> ()
92 call @body2(%i, %j) : (index, index) -> ()
94 call @mid(%i) : (index) -> ()
96 call @body3(%i, %k) : (index, index) -> ()
98 call @post(%i) : (index) -> ()
104 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
105 // CHECK-NEXT: %[[c1:.*]] = constant 1 : index
107 // CHECK-NEXT: %[[c42:.*]] = constant 42 : index
108 // CHECK-NEXT: %[[c1_0:.*]] = constant 1 : index
110 // CHECK-NEXT: call @body2(%{{.*}}, %{{.*}}) : (index, index) -> ()
115 func @affine_apply_loops_shorthand(%N : index) {
118 call @body2(%i, %j) : (index, index) -> ()
126 func private @get_idx() -> (index)
132 // CHECK-NEXT: %[[v0:.*]] = call @get_idx() : () -> index
133 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
134 // CHECK-NEXT: %[[cm1:.*]] = constant -1 : index
135 // CHECK-NEXT: %[[v1:.*]] = muli %[[v0]], %[[cm1]] : index
136 // CHECK-NEXT: %[[c20:.*]] = constant 20 : index
137 // CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %[[c20]] : index
138 // CHECK-NEXT: %[[v3:.*]] = cmpi "sge", %[[v2]], %[[c0]] : index
140 // CHECK-NEXT: call @body(%[[v0:.*]]) : (index) -> ()
145 %i = call @get_idx() : () -> (index)
147 call @body(%i) : (index) -> ()
153 // CHECK-NEXT: %[[v0:.*]] = call @get_idx() : () -> index
154 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
155 // CHECK-NEXT: %[[cm1:.*]] = constant -1 : index
156 // CHECK-NEXT: %[[v1:.*]] = muli %[[v0]], %[[cm1]] : index
157 // CHECK-NEXT: %[[c20:.*]] = constant 20 : index
158 // CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %[[c20]] : index
159 // CHECK-NEXT: %[[v3:.*]] = cmpi "sge", %[[v2]], %[[c0]] : index
161 // CHECK-NEXT: call @body(%[[v0:.*]]) : (index) -> ()
163 // CHECK-NEXT: call @mid(%[[v0:.*]]) : (index) -> ()
168 %i = call @get_idx() : () -> (index)
170 call @body(%i) : (index) -> ()
172 call @mid(%i) : (index) -> ()
178 // CHECK-NEXT: %[[v0:.*]] = call @get_idx() : () -> index
179 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
180 // CHECK-NEXT: %[[cm1:.*]] = constant -1 : index
181 // CHECK-NEXT: %[[v1:.*]] = muli %[[v0]], %[[cm1]] : index
182 // CHECK-NEXT: %[[c20:.*]] = constant 20 : index
183 // CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %[[c20]] : index
184 // CHECK-NEXT: %[[v3:.*]] = cmpi "sge", %[[v2]], %[[c0]] : index
186 // CHECK-NEXT: %[[c0_0:.*]] = constant 0 : index
187 // CHECK-NEXT: %[[cm10:.*]] = constant -10 : index
188 // CHECK-NEXT: %[[v4:.*]] = addi %[[v0]], %[[cm10]] : index
189 // CHECK-NEXT: %[[v5:.*]] = cmpi "sge", %[[v4]], %[[c0_0]] : index
191 // CHECK-NEXT: call @body(%[[v0:.*]]) : (index) -> ()
194 // CHECK-NEXT: %[[c0_0:.*]] = constant 0 : index
195 // CHECK-NEXT: %[[cm10:.*]] = constant -10 : index
196 // CHECK-NEXT: %{{.*}} = addi %[[v0]], %[[cm10]] : index
197 // CHECK-NEXT: %{{.*}} = cmpi "sge", %{{.*}}, %[[c0_0]] : index
199 // CHECK-NEXT: call @mid(%[[v0:.*]]) : (index) -> ()
205 %i = call @get_idx() : () -> (index)
208 call @body(%i) : (index) -> ()
212 call @mid(%i) : (index) -> ()
221 // CHECK-NEXT: %[[v0:.*]] = call @get_idx() : () -> index
222 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
223 // CHECK-NEXT: %[[cm1:.*]] = constant -1 : index
224 // CHECK-NEXT: %[[v1:.*]] = muli %[[v0]], %[[cm1]] : index
225 // CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %{{.*}} : index
226 // CHECK-NEXT: %[[c1:.*]] = constant 1 : index
227 // CHECK-NEXT: %[[v3:.*]] = addi %[[v2]], %[[c1]] : index
228 // CHECK-NEXT: %[[v4:.*]] = cmpi "sge", %[[v3]], %[[c0]] : index
229 // CHECK-NEXT: %[[cm1_0:.*]] = constant -1 : index
230 // CHECK-NEXT: %[[v5:.*]] = addi %{{.*}}, %[[cm1_0]] : index
231 // CHECK-NEXT: %[[v6:.*]] = cmpi "sge", %[[v5]], %[[c0]] : index
233 // CHECK-NEXT: %[[cm1_1:.*]] = constant -1 : index
234 // CHECK-NEXT: %[[v8:.*]] = addi %{{.*}}, %[[cm1_1]] : index
235 // CHECK-NEXT: %[[v9:.*]] = cmpi "sge", %[[v8]], %[[c0]] : index
237 // CHECK-NEXT: %[[cm1_2:.*]] = constant -1 : index
238 // CHECK-NEXT: %[[v11:.*]] = addi %{{.*}}, %[[cm1_2]] : index
239 // CHECK-NEXT: %[[v12:.*]] = cmpi "sge", %[[v11]], %[[c0]] : index
241 // CHECK-NEXT: %[[cm42:.*]] = constant -42 : index
242 // CHECK-NEXT: %[[v14:.*]] = addi %{{.*}}, %[[cm42]] : index
243 // CHECK-NEXT: %[[v15:.*]] = cmpi "eq", %[[v14]], %[[c0]] : index
246 // CHECK-NEXT: call @body(%[[v0:.*]]) : (index) -> ()
248 // CHECK-NEXT: call @mid(%[[v0:.*]]) : (index) -> ()
252 func @multi_cond(%N : index, %M : index, %K : index, %L : index) {
253 %i = call @get_idx() : () -> (index)
255 call @body(%i) : (index) -> ()
257 call @mid(%i) : (index) -> ()
264 // CHECK-NEXT: %[[v0:.*]] = call @get_idx() : () -> index
265 %i = call @get_idx() : () -> (index)
266 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
267 // CHECK-NEXT: %[[cm1:.*]] = constant -1 : index
268 // CHECK-NEXT: %[[v1:.*]] = muli %[[v0]], %[[cm1]] : index
269 // CHECK-NEXT: %[[c20:.*]] = constant 20 : index
270 // CHECK-NEXT: %[[v2:.*]] = addi %[[v1]], %[[c20]] : index
271 // CHECK-NEXT: %[[v3:.*]] = cmpi "sge", %[[v2]], %[[c0]] : index
273 // CHECK-NEXT: %[[c0:.*]]{{.*}} = constant 0 : index
274 // CHECK-NEXT: %[[c42:.*]]{{.*}} = constant 42 : index
275 // CHECK-NEXT: %[[c1:.*]]{{.*}} = constant 1 : index
277 // CHECK-NEXT: %[[c0_:.*]]{{.*}} = constant 0 : index
278 // CHECK-NEXT: %[[cm10:.*]] = constant -10 : index
279 // CHECK-NEXT: %[[v4:.*]] = addi %{{.*}}, %[[cm10]] : index
280 // CHECK-NEXT: %[[v5:.*]] = cmpi "sge", %[[v4]], %[[c0_:.*]]{{.*}} : index
282 // CHECK-NEXT: call @body2(%[[v0]], %{{.*}}) : (index, index) -> ()
286 call @body2(%i, %j) : (index, index) -> ()
290 // CHECK: %[[c0:.*]]{{.*}} = constant 0 : index
291 // CHECK-NEXT: %[[c42:.*]]{{.*}} = constant 42 : index
292 // CHECK-NEXT: %[[c1:.*]]{{.*}} = constant 1 : index
294 // CHECK-NEXT: %[[c0:.*]]{{.*}} = constant 0 : index
295 // CHECK-NEXT: %[[cm10:.*]]{{.*}} = constant -10 : index
296 // CHECK-NEXT: %{{.*}} = addi %{{.*}}, %[[cm10:.*]]{{.*}} : index
297 // CHECK-NEXT: %{{.*}} = cmpi "sge", %{{.*}}, %[[c0:.*]]{{.*}} : index
299 // CHECK-NEXT: %[[c0_:.*]]{{.*}} = constant 0 : index
300 // CHECK-NEXT: %[[c42_:.*]]{{.*}} = constant 42 : index
301 // CHECK-NEXT: %[[c1_:.*]]{{.*}} = constant 1 : index
306 call @body3(%k, %l) : (index, index) -> ()
318 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
319 // CHECK-NEXT: %[[c42:.*]] = constant 42 : index
320 // CHECK-NEXT: %[[c1:.*]] = constant 1 : index
322 // CHECK-NEXT: %[[cm1:.*]] = constant -1 : index
323 // CHECK-NEXT: %[[a:.*]] = muli %{{.*}}, %[[cm1]] : index
324 // CHECK-NEXT: %[[b:.*]] = addi %[[a]], %{{.*}} : index
325 // CHECK-NEXT: %[[c:.*]] = cmpi "sgt", %{{.*}}, %[[b]] : index
326 // CHECK-NEXT: %[[d:.*]] = select %[[c]], %{{.*}}, %[[b]] : index
327 // CHECK-NEXT: %[[c10:.*]] = constant 10 : index
328 // CHECK-NEXT: %[[e:.*]] = addi %{{.*}}, %[[c10]] : index
329 // CHECK-NEXT: %[[f:.*]] = cmpi "slt", %{{.*}}, %[[e]] : index
330 // CHECK-NEXT: %[[g:.*]] = select %[[f]], %{{.*}}, %[[e]] : index
331 // CHECK-NEXT: %[[c1_0:.*]] = constant 1 : index
333 // CHECK-NEXT: call @body2(%{{.*}}, %{{.*}}) : (index, index) -> ()
338 func @loop_min_max(%N : index) {
341 call @body2(%i, %j) : (index, index) -> ()
353 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
354 // CHECK-NEXT: %[[c01:.+]] = cmpi "slt", %{{.*}}, %{{.*}} : index
355 // CHECK-NEXT: %[[r01:.+]] = select %[[c01]], %{{.*}}, %{{.*}} : index
356 // CHECK-NEXT: %[[c012:.+]] = cmpi "slt", %[[r01]], %{{.*}} : index
357 // CHECK-NEXT: %[[r012:.+]] = select %[[c012]], %[[r01]], %{{.*}} : index
358 // CHECK-NEXT: %[[c0123:.+]] = cmpi "slt", %[[r012]], %{{.*}} : index
359 // CHECK-NEXT: %[[r0123:.+]] = select %[[c0123]], %[[r012]], %{{.*}} : index
360 // CHECK-NEXT: %[[c01234:.+]] = cmpi "slt", %[[r0123]], %{{.*}} : index
361 // CHECK-NEXT: %[[r01234:.+]] = select %[[c01234]], %[[r0123]], %{{.*}} : index
362 // CHECK-NEXT: %[[c012345:.+]] = cmpi "slt", %[[r01234]], %{{.*}} : index
363 // CHECK-NEXT: %[[r012345:.+]] = select %[[c012345]], %[[r01234]], %{{.*}} : index
364 // CHECK-NEXT: %[[c0123456:.+]] = cmpi "slt", %[[r012345]], %{{.*}} : index
365 // CHECK-NEXT: %[[r0123456:.+]] = select %[[c0123456]], %[[r012345]], %{{.*}} : index
366 // CHECK-NEXT: %[[c1:.*]] = constant 1 : index
368 // CHECK-NEXT: call @body(%{{.*}}) : (index) -> ()
372 func @min_reduction_tree(%v1 : index, %v2 : index, %v3 : index, %v4 : index, %v5 : index, %v6 : ind…
374 call @body(%i) : (index) -> ()
390 func @affine_applies(%arg0 : index) {
391 // CHECK: %[[c0:.*]] = constant 0 : index
395 // CHECK-NEXT: %[[c101:.*]] = constant 101 : index
396 %101 = constant 101 : index
398 // CHECK-NEXT: %[[c102:.*]] = constant 102 : index
399 %102 = constant 102 : index
402 // CHECK-NEXT: %[[v0:.*]] = addi %[[c0]], %[[c0]] : index
403 // CHECK-NEXT: %[[c1:.*]] = constant 1 : index
404 // CHECK-NEXT: %[[v1:.*]] = addi %[[v0]], %[[c1]] : index
407 // CHECK-NEXT: %[[c2:.*]] = constant 2 : index
408 // CHECK-NEXT: %[[v2:.*]] = muli %arg0, %[[c2]] : index
409 // CHECK-NEXT: %[[v3:.*]] = addi %arg0, %[[v2]] : index
410 // CHECK-NEXT: %[[c3:.*]] = constant 3 : index
411 // CHECK-NEXT: %[[v4:.*]] = muli %arg0, %[[c3]] : index
412 // CHECK-NEXT: %[[v5:.*]] = addi %[[v3]], %[[v4]] : index
413 // CHECK-NEXT: %[[c4:.*]] = constant 4 : index
414 // CHECK-NEXT: %[[v6:.*]] = muli %arg0, %[[c4]] : index
415 // CHECK-NEXT: %[[v7:.*]] = addi %[[v5]], %[[v6]] : index
416 // CHECK-NEXT: %[[c5:.*]] = constant 5 : index
417 // CHECK-NEXT: %[[v8:.*]] = muli %arg0, %[[c5]] : index
418 // CHECK-NEXT: %[[v9:.*]] = addi %[[v7]], %[[v8]] : index
419 // CHECK-NEXT: %[[c6:.*]] = constant 6 : index
420 // CHECK-NEXT: %[[v10:.*]] = muli %arg0, %[[c6]] : index
421 // CHECK-NEXT: %[[v11:.*]] = addi %[[v9]], %[[v10]] : index
422 // CHECK-NEXT: %[[c7:.*]] = constant 7 : index
423 // CHECK-NEXT: %[[v12:.*]] = muli %arg0, %[[c7]] : index
424 // CHECK-NEXT: %[[v13:.*]] = addi %[[v11]], %[[v12]] : index
430 func @args_ret_affine_apply(index, index) -> (index, index) {
431 ^bb0(%0 : index, %1 : index):
432 // CHECK-NEXT: return %{{.*}}, %{{.*}} : index, index
435 return %00, %11 : index, index
453 func @affine_apply_mod(%arg0 : index) -> (index) {
454 // CHECK-NEXT: %[[c42:.*]] = constant 42 : index
455 // CHECK-NEXT: %[[v0:.*]] = remi_signed %{{.*}}, %[[c42]] : index
456 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
457 // CHECK-NEXT: %[[v1:.*]] = cmpi "slt", %[[v0]], %[[c0]] : index
458 // CHECK-NEXT: %[[v2:.*]] = addi %[[v0]], %[[c42]] : index
459 // CHECK-NEXT: %[[v3:.*]] = select %[[v1]], %[[v2]], %[[v0]] : index
461 return %0 : index
472 func @affine_apply_floordiv(%arg0 : index) -> (index) {
473 // CHECK-NEXT: %[[c42:.*]] = constant 42 : index
474 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
475 // CHECK-NEXT: %[[cm1:.*]] = constant -1 : index
476 // CHECK-NEXT: %[[v0:.*]] = cmpi "slt", %{{.*}}, %[[c0]] : index
477 // CHECK-NEXT: %[[v1:.*]] = subi %[[cm1]], %{{.*}} : index
478 // CHECK-NEXT: %[[v2:.*]] = select %[[v0]], %[[v1]], %{{.*}} : index
479 // CHECK-NEXT: %[[v3:.*]] = divi_signed %[[v2]], %[[c42]] : index
480 // CHECK-NEXT: %[[v4:.*]] = subi %[[cm1]], %[[v3]] : index
481 // CHECK-NEXT: %[[v5:.*]] = select %[[v0]], %[[v4]], %[[v3]] : index
483 return %0 : index
494 func @affine_apply_ceildiv(%arg0 : index) -> (index) {
495 // CHECK-NEXT: %[[c42:.*]] = constant 42 : index
496 // CHECK-NEXT: %[[c0:.*]] = constant 0 : index
497 // CHECK-NEXT: %[[c1:.*]] = constant 1 : index
498 // CHECK-NEXT: %[[v0:.*]] = cmpi "sle", %{{.*}}, %[[c0]] : index
499 // CHECK-NEXT: %[[v1:.*]] = subi %[[c0]], %{{.*}} : index
500 // CHECK-NEXT: %[[v2:.*]] = subi %{{.*}}, %[[c1]] : index
501 // CHECK-NEXT: %[[v3:.*]] = select %[[v0]], %[[v1]], %[[v2]] : index
502 // CHECK-NEXT: %[[v4:.*]] = divi_signed %[[v3]], %[[c42]] : index
503 // CHECK-NEXT: %[[v5:.*]] = subi %[[c0]], %[[v4]] : index
504 // CHECK-NEXT: %[[v6:.*]] = addi %[[v4]], %[[c1]] : index
505 // CHECK-NEXT: %[[v7:.*]] = select %[[v0]], %[[v5]], %[[v6]] : index
507 return %0 : index
511 func @affine_load(%arg0 : index) {
516 // CHECK: %[[a:.*]] = addi %{{.*}}, %{{.*}} : index
517 // CHECK-NEXT: %[[c7:.*]] = constant 7 : index
518 // CHECK-NEXT: %[[b:.*]] = addi %[[a]], %[[c7]] : index
524 func @affine_store(%arg0 : index) {
530 // CHECK: %c-1 = constant -1 : index
531 // CHECK-NEXT: %[[a:.*]] = muli %arg0, %c-1 : index
532 // CHECK-NEXT: %[[b:.*]] = addi %{{.*}}, %[[a]] : index
533 // CHECK-NEXT: %c7 = constant 7 : index
534 // CHECK-NEXT: %[[c:.*]] = addi %[[b]], %c7 : index
549 func @affine_prefetch(%arg0 : index) {
554 // CHECK: %[[a:.*]] = addi %{{.*}}, %{{.*}} : index
555 // CHECK-NEXT: %[[c7:.*]] = constant 7 : index
556 // CHECK-NEXT: %[[b:.*]] = addi %[[a]], %[[c7]] : index
562 func @affine_dma_start(%arg0 : index) {
566 %c0 = constant 0 : index
567 %c64 = constant 64 : index
572 // CHECK: %c7 = constant 7 : index
573 // CHECK-NEXT: %[[a:.*]] = addi %{{.*}}, %c7 : index
574 // CHECK-NEXT: %c11 = constant 11 : index
575 // CHECK-NEXT: %[[b:.*]] = addi %arg0, %c11 : index
581 func @affine_dma_wait(%arg0 : index) {
583 %c64 = constant 64 : index
587 // CHECK: %[[a:.*]] = addi %{{.*}}, %arg0 : index
588 // CHECK-NEXT: %c17 = constant 17 : index
589 // CHECK-NEXT: %[[b:.*]] = addi %[[a]], %c17 : index
595 // CHECK-SAME: %[[ARG0:.*]]: index, %[[ARG1:.*]]: index
596 func @affine_min(%arg0: index, %arg1: index) -> index{
606 return %0 : index
610 // CHECK-SAME: %[[ARG0:.*]]: index, %[[ARG1:.*]]: index
611 func @affine_max(%arg0: index, %arg1: index) -> index{
621 return %0 : index