Lines Matching full:by
3 …gistered-dialect %s -affine-loop-unroll="unroll-factor=4" | FileCheck %s --check-prefix UNROLL-BY-4
4 …gistered-dialect %s -affine-loop-unroll="unroll-factor=1" | FileCheck %s --check-prefix UNROLL-BY-1
16 // UNROLL-BY-4-DAG: [[$MAP0:#map[0-9]+]] = affine_map<(d0) -> (d0 + 1)>
17 // UNROLL-BY-4-DAG: [[$MAP1:#map[0-9]+]] = affine_map<(d0) -> (d0 + 2)>
18 // UNROLL-BY-4-DAG: [[$MAP2:#map[0-9]+]] = affine_map<(d0) -> (d0 + 3)>
19 // UNROLL-BY-4-DAG: [[$MAP3:#map[0-9]+]] = affine_map<(d0, d1) -> (d0 + 1)>
20 // UNROLL-BY-4-DAG: [[$MAP4:#map[0-9]+]] = affine_map<(d0, d1) -> (d0 + 3)>
21 // UNROLL-BY-4-DAG: [[$MAP5:#map[0-9]+]] = affine_map<(d0)[s0] -> (d0 + s0 + 1)>
22 // UNROLL-BY-4-DAG: [[$MAP6:#map[0-9]+]] = affine_map<(d0, d1) -> (d0 * 16 + d1)>
23 // UNROLL-BY-4-DAG: [[$MAP11:#map[0-9]+]] = affine_map<(d0) -> (d0)>
24 // UNROLL-BY-4-DAG: [[$MAP_TRIP_COUNT_MULTIPLE_FOUR:#map[0-9]+]] = affine_map<()[s0, s1, s2] -> (s0…
319 // UNROLL-BY-4-LABEL: func @unroll_unit_stride_no_cleanup() {
321 // UNROLL-BY-4: affine.for %arg0 = 0 to 100 {
323 // UNROLL-BY-4: for [[L1:%arg[0-9]+]] = 0 to 8 step 4 {
324 // UNROLL-BY-4-NEXT: %0 = "addi32"([[L1]], [[L1]]) : (index, index) -> i32
325 // UNROLL-BY-4-NEXT: %1 = "addi32"(%0, %0) : (i32, i32) -> i32
326 // UNROLL-BY-4-NEXT: %2 = affine.apply #map{{[0-9]+}}([[L1]])
327 // UNROLL-BY-4-NEXT: %3 = "addi32"(%2, %2) : (index, index) -> i32
328 // UNROLL-BY-4-NEXT: %4 = "addi32"(%3, %3) : (i32, i32) -> i32
329 // UNROLL-BY-4-NEXT: %5 = affine.apply #map{{[0-9]+}}([[L1]])
330 // UNROLL-BY-4-NEXT: %6 = "addi32"(%5, %5) : (index, index) -> i32
331 // UNROLL-BY-4-NEXT: %7 = "addi32"(%6, %6) : (i32, i32) -> i32
332 // UNROLL-BY-4-NEXT: %8 = affine.apply #map{{[0-9]+}}([[L1]])
333 // UNROLL-BY-4-NEXT: %9 = "addi32"(%8, %8) : (index, index) -> i32
334 // UNROLL-BY-4-NEXT: %10 = "addi32"(%9, %9) : (i32, i32) -> i32
335 // UNROLL-BY-4-NEXT: }
341 // UNROLL-BY-4: affine.for %arg1 = 0 to 8 {
348 // UNROLL-BY-4-LABEL: func @unroll_unit_stride_cleanup() {
350 // UNROLL-BY-4: affine.for %arg0 = 0 to 100 {
352 // UNROLL-BY-4: for [[L1:%arg[0-9]+]] = 0 to 8 step 4 {
353 // UNROLL-BY-4-NEXT: %0 = "addi32"([[L1]], [[L1]]) : (index, index) -> i32
354 // UNROLL-BY-4-NEXT: %1 = "addi32"(%0, %0) : (i32, i32) -> i32
355 // UNROLL-BY-4-NEXT: %2 = affine.apply #map{{[0-9]+}}([[L1]])
356 // UNROLL-BY-4-NEXT: %3 = "addi32"(%2, %2) : (index, index) -> i32
357 // UNROLL-BY-4-NEXT: %4 = "addi32"(%3, %3) : (i32, i32) -> i32
358 // UNROLL-BY-4-NEXT: %5 = affine.apply #map{{[0-9]+}}([[L1]])
359 // UNROLL-BY-4-NEXT: %6 = "addi32"(%5, %5) : (index, index) -> i32
360 // UNROLL-BY-4-NEXT: %7 = "addi32"(%6, %6) : (i32, i32) -> i32
361 // UNROLL-BY-4-NEXT: %8 = affine.apply #map{{[0-9]+}}([[L1]])
362 // UNROLL-BY-4-NEXT: %9 = "addi32"(%8, %8) : (index, index) -> i32
363 // UNROLL-BY-4-NEXT: %10 = "addi32"(%9, %9) : (i32, i32) -> i32
364 // UNROLL-BY-4-NEXT: }
365 // UNROLL-BY-4-NEXT: for [[L2:%arg[0-9]+]] = 8 to 10 {
366 // UNROLL-BY-4-NEXT: %0 = "addi32"([[L2]], [[L2]]) : (index, index) -> i32
367 // UNROLL-BY-4-NEXT: %1 = "addi32"(%0, %0) : (i32, i32) -> i32
368 // UNROLL-BY-4-NEXT: }
377 // UNROLL-BY-4-LABEL: func @unroll_non_unit_stride_cleanup() {
379 // UNROLL-BY-4: affine.for %arg0 = 0 to 100 {
381 // UNROLL-BY-4: for [[L1:%arg[0-9]+]] = 2 to 42 step 20 {
382 // UNROLL-BY-4-NEXT: %0 = "addi32"([[L1]], [[L1]]) : (index, index) -> i32
383 // UNROLL-BY-4-NEXT: %1 = "addi32"(%0, %0) : (i32, i32) -> i32
384 // UNROLL-BY-4-NEXT: %2 = affine.apply #map{{[0-9]+}}([[L1]])
385 // UNROLL-BY-4-NEXT: %3 = "addi32"(%2, %2) : (index, index) -> i32
386 // UNROLL-BY-4-NEXT: %4 = "addi32"(%3, %3) : (i32, i32) -> i32
387 // UNROLL-BY-4-NEXT: %5 = affine.apply #map{{[0-9]+}}([[L1]])
388 // UNROLL-BY-4-NEXT: %6 = "addi32"(%5, %5) : (index, index) -> i32
389 // UNROLL-BY-4-NEXT: %7 = "addi32"(%6, %6) : (i32, i32) -> i32
390 // UNROLL-BY-4-NEXT: %8 = affine.apply #map{{[0-9]+}}([[L1]])
391 // UNROLL-BY-4-NEXT: %9 = "addi32"(%8, %8) : (index, index) -> i32
392 // UNROLL-BY-4-NEXT: %10 = "addi32"(%9, %9) : (i32, i32) -> i32
393 // UNROLL-BY-4-NEXT: }
394 // UNROLL-BY-4-NEXT: for [[L2:%arg[0-9]+]] = 42 to 48 step 5 {
395 // UNROLL-BY-4-NEXT: %0 = "addi32"([[L2]], [[L2]]) : (index, index) -> i32
396 // UNROLL-BY-4-NEXT: %1 = "addi32"(%0, %0) : (i32, i32) -> i32
397 // UNROLL-BY-4-NEXT: }
407 // UNROLL-BY-4-LABEL: func @loop_nest_single_iteration_after_unroll
409 // UNROLL-BY-4: %c0 = constant 0 : index
410 // UNROLL-BY-4: %c4 = constant 4 : index
411 // UNROLL-BY-4: affine.for %arg1 = 0 to %arg0 {
413 // UNROLL-BY-4: %0 = "addi32"(%c0, %c0) : (index, index) -> i32
414 // UNROLL-BY-4-NEXT: %1 = affine.apply [[$MAP0]](%c0)
415 // UNROLL-BY-4-NEXT: %2 = "addi32"(%1, %1) : (index, index) -> i32
416 // UNROLL-BY-4-NEXT: %3 = affine.apply [[$MAP1]](%c0)
417 // UNROLL-BY-4-NEXT: %4 = "addi32"(%3, %3) : (index, index) -> i32
418 // UNROLL-BY-4-NEXT: %5 = affine.apply [[$MAP2]](%c0)
419 // UNROLL-BY-4-NEXT: %6 = "addi32"(%5, %5) : (index, index) -> i32
420 // UNROLL-BY-4-NEXT: %7 = "addi32"(%c4, %c4) : (index, index) -> i32
421 // UNROLL-BY-4-NOT: for
424 } // UNROLL-BY-4-NOT: }
425 } // UNROLL-BY-4: }
432 // UNROLL-BY-4-LABEL: func @loop_nest_operand1() {
434 // UNROLL-BY-4: affine.for %arg0 = 0 to 100 step 2 {
435 // UNROLL-BY-4-NEXT: affine.for %arg1 = 0 to #map{{[0-9]+}}(%arg0) step 4
436 // UNROLL-BY-4-NEXT: %0 = "foo"() : () -> i32
437 // UNROLL-BY-4-NEXT: %1 = "foo"() : () -> i32
438 // UNROLL-BY-4-NEXT: %2 = "foo"() : () -> i32
439 // UNROLL-BY-4-NEXT: %3 = "foo"() : () -> i32
440 // UNROLL-BY-4-NEXT: }
441 // UNROLL-BY-4-NEXT: }
442 // UNROLL-BY-4-NEXT: return
452 // UNROLL-BY-4-LABEL: func @loop_nest_operand2() {
454 // UNROLL-BY-4: affine.for %arg0 = 0 to 100 step 2 {
455 // UNROLL-BY-4-NEXT: affine.for %arg1 = [[$MAP11]](%arg0) to #map{{[0-9]+}}(%arg0) step 4 {
456 // UNROLL-BY-4-NEXT: %0 = "foo"() : () -> i32
457 // UNROLL-BY-4-NEXT: %1 = "foo"() : () -> i32
458 // UNROLL-BY-4-NEXT: %2 = "foo"() : () -> i32
459 // UNROLL-BY-4-NEXT: %3 = "foo"() : () -> i32
460 // UNROLL-BY-4-NEXT: }
461 // UNROLL-BY-4-NEXT: }
462 // UNROLL-BY-4-NEXT: return
473 // UNROLL-BY-4-LABEL: func @loop_nest_operand3() {
475 // UNROLL-BY-4: affine.for %arg0 = 0 to 100 step 2 {
477 // UNROLL-BY-4: affine.for %arg1 = [[$MAP11]](%arg0) to #map{{[0-9]+}}(%arg0) step 4 {
478 // UNROLL-BY-4-NEXT: %1 = "foo"() : () -> i32
479 // UNROLL-BY-4-NEXT: %2 = "foo"() : () -> i32
480 // UNROLL-BY-4-NEXT: %3 = "foo"() : () -> i32
481 // UNROLL-BY-4-NEXT: %4 = "foo"() : () -> i32
482 // UNROLL-BY-4-NEXT: }
483 // UNROLL-BY-4-NEXT: %0 = "foo"() : () -> i32
487 } // UNROLL-BY-4: }
491 // UNROLL-BY-4-LABEL: func @loop_nest_symbolic_bound(%arg0: index) {
493 // UNROLL-BY-4: affine.for %arg1 = 0 to 100 {
495 // UNROLL-BY-4: affine.for %arg2 = 0 to #map{{[0-9]+}}()[%arg0] step 4 {
496 // UNROLL-BY-4: %0 = "foo"() : () -> i32
497 // UNROLL-BY-4-NEXT: %1 = "foo"() : () -> i32
498 // UNROLL-BY-4-NEXT: %2 = "foo"() : () -> i32
499 // UNROLL-BY-4-NEXT: %3 = "foo"() : () -> i32
500 // UNROLL-BY-4-NEXT: }
502 // UNROLL-BY-4-NEXT: affine.for %arg2 = #map{{[0-9]+}}()[%arg0] to %arg0 {
503 // UNROLL-BY-4-NEXT: %0 = "foo"() : () -> i32
504 // UNROLL-BY-4-NEXT: }
512 // UNROLL-BY-4-LABEL: func @loop_nest_symbolic_bound_with_step
513 // UNROLL-BY-4-SAME: %[[N:.*]]: index
515 // UNROLL-BY-4: affine.for %arg1 = 0 to 100 {
520 // UNROLL-BY-4: affine.for %{{.*}} = 0 to #map{{[0-9]+}}()[%[[N]]] step 12 {
521 // UNROLL-BY-4: "foo"()
522 // UNROLL-BY-4-NEXT: "foo"()
523 // UNROLL-BY-4-NEXT: "foo"()
524 // UNROLL-BY-4-NEXT: "foo"()
525 // UNROLL-BY-4-NEXT: }
527 // UNROLL-BY-4-NEXT: affine.for %{{.*}} = #map{{[0-9]+}}()[%[[N]]] to %[[N]] step 3 {
528 // UNROLL-BY-4-NEXT: "foo"()
529 // UNROLL-BY-4-NEXT: }
534 // UNROLL-BY-4-LABEL: func @loop_nest_symbolic_and_min_upper_bound
554 // UNROLL-BY-4-LABEL: func @loop_nest_non_trivial_multiple_upper_bound
563 // UNROLL-BY-4: affine.for %arg2 = 0 to min
564 // UNROLL-BY-4-NOT: for
565 // UNROLL-BY-4: return
567 // UNROLL-BY-4-LABEL: func @loop_nest_non_trivial_multiple_upper_bound_alt
573 // UNROLL-BY-4: affine.for %arg2 = 0 to min
574 // UNROLL-BY-4-NEXT: "foo"
575 // UNROLL-BY-4-NEXT: "foo"
576 // UNROLL-BY-4-NEXT: "foo"
577 // UNROLL-BY-4-NEXT: "foo"
578 // UNROLL-BY-4-NOT for
579 // UNROLL-BY-4: return
583 // UNROLL-BY-1-LABEL: func @unroll_by_one_should_promote_single_iteration_loop()
589 // UNROLL-BY-1-NEXT: %c0 = constant 0 : index
590 // UNROLL-BY-1-NEXT: %0 = "foo"(%c0) : (index) -> i32
591 // UNROLL-BY-1-NEXT: return