From ff6249a222d760651b074e3a30408cd270579689 Mon Sep 17 00:00:00 2001 From: Emilien Bauer Date: Wed, 31 May 2023 19:00:59 +0100 Subject: [PATCH] Merge all conversion to CPU filechecks in one transformation filecheck. Some were just removed, e.g. separate load/cast/access tests, which are just tested in every example. --- tests/filecheck/dialects/stencil/hdiff.mlir | 99 ----- .../stencil/heat_stencil_inference_ll.mlir | 419 ------------------ tests/filecheck/dialects/stencil/iterate.mlir | 61 --- .../stencil/stencil_apply_float_arg.mlir | 84 ---- .../stencil/test_access_lowering_1d.mlir | 34 -- .../stencil/test_access_lowering_2d.mlir | 41 -- .../stencil/test_access_lowering_3d.mlir | 48 -- .../dialects/stencil/test_apply_lowering.mlir | 42 -- .../stencil/test_castop_lowering_1d.mlir | 17 - .../stencil/test_castop_lowering_3d.mlir | 17 - .../stencil/test_funcop_lowering.mlir | 20 - .../stencil/test_loadop_lowering.mlir | 19 - .../dialects/stencil/test_store_lowering.mlir | 53 --- .../convert-stencil-to-ll-mlir.mlir | 304 +++++++++++++ 14 files changed, 304 insertions(+), 954 deletions(-) delete mode 100644 tests/filecheck/dialects/stencil/hdiff.mlir delete mode 100644 tests/filecheck/dialects/stencil/heat_stencil_inference_ll.mlir delete mode 100644 tests/filecheck/dialects/stencil/iterate.mlir delete mode 100644 tests/filecheck/dialects/stencil/stencil_apply_float_arg.mlir delete mode 100644 tests/filecheck/dialects/stencil/test_access_lowering_1d.mlir delete mode 100644 tests/filecheck/dialects/stencil/test_access_lowering_2d.mlir delete mode 100644 tests/filecheck/dialects/stencil/test_access_lowering_3d.mlir delete mode 100644 tests/filecheck/dialects/stencil/test_apply_lowering.mlir delete mode 100644 tests/filecheck/dialects/stencil/test_castop_lowering_1d.mlir delete mode 100644 tests/filecheck/dialects/stencil/test_castop_lowering_3d.mlir delete mode 100644 tests/filecheck/dialects/stencil/test_funcop_lowering.mlir delete mode 100644 tests/filecheck/dialects/stencil/test_loadop_lowering.mlir delete mode 100644 tests/filecheck/dialects/stencil/test_store_lowering.mlir create mode 100644 tests/filecheck/transforms/convert-stencil-to-ll-mlir.mlir diff --git a/tests/filecheck/dialects/stencil/hdiff.mlir b/tests/filecheck/dialects/stencil/hdiff.mlir deleted file mode 100644 index cea2492a21..0000000000 --- a/tests/filecheck/dialects/stencil/hdiff.mlir +++ /dev/null @@ -1,99 +0,0 @@ -// RUN: xdsl-opt %s -p stencil-shape-inference,convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : !stencil.field, %1 : !stencil.field, %2 : !stencil.field): - %3 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> - %4 = "stencil.cast"(%1) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> - %5 = "stencil.cast"(%2) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> - %6 = "stencil.load"(%3) : (!stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>) -> !stencil.temp - %7, %8 = "stencil.apply"(%6) ({ - ^1(%9 : !stencil.temp): - %10 = "stencil.access"(%9) {"offset" = #stencil.index<-1, 0, 0>} : (!stencil.temp) -> f64 - %11 = "stencil.access"(%9) {"offset" = #stencil.index<1, 0, 0>} : (!stencil.temp) -> f64 - %12 = "stencil.access"(%9) {"offset" = #stencil.index<0, 1, 0>} : (!stencil.temp) -> f64 - %13 = "stencil.access"(%9) {"offset" = #stencil.index<0, -1, 0>} : (!stencil.temp) -> f64 - %14 = "stencil.access"(%9) {"offset" = #stencil.index<0, 0, 0>} : (!stencil.temp) -> f64 - %15 = "arith.addf"(%10, %11) : (f64, f64) -> f64 - %16 = "arith.addf"(%12, %13) : (f64, f64) -> f64 - %17 = "arith.addf"(%15, %16) : (f64, f64) -> f64 - %cst = "arith.constant"() {"value" = -4.0 : f64} : () -> f64 - %18 = "arith.mulf"(%14, %cst) : (f64, f64) -> f64 - %19 = "arith.addf"(%18, %17) : (f64, f64) -> f64 - "stencil.return"(%19, %18) : (f64, f64) -> () - }) : (!stencil.temp) -> (!stencil.temp, !stencil.temp) - "stencil.store"(%7, %4) {"lb" = #stencil.index<0, 0, 0>, "ub" = #stencil.index<64, 64, 64>} : (!stencil.temp, !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>) -> () - "func.return"() : () -> () - }) {"function_type" = (!stencil.field, !stencil.field, !stencil.field) -> (), "sym_name" = "stencil_hdiff"} : () -> () -}) : () -> () - -// CHECK: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : memref, %1 : memref, %2 : memref): -// CHECK-NEXT: %3 = "memref.cast"(%0) : (memref) -> memref<72x72x72xf64> -// CHECK-NEXT: %4 = "memref.cast"(%1) : (memref) -> memref<72x72x72xf64> -// CHECK-NEXT: %5 = "memref.subview"(%4) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72x72xf64>) -> memref<64x64x64xf64, strided<[5184, 72, 1], offset: 21028>> -// CHECK-NEXT: %6 = "memref.cast"(%2) : (memref) -> memref<72x72x72xf64> -// CHECK-NEXT: %7 = "memref.subview"(%3) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72x72xf64>) -> memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>> -// CHECK-NEXT: %8 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %9 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %10 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %11 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %12 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%8, %10, %9) ({ -// CHECK-NEXT: ^1(%13 : index): -// CHECK-NEXT: "scf.for"(%8, %11, %9) ({ -// CHECK-NEXT: ^2(%14 : index): -// CHECK-NEXT: "scf.for"(%8, %12, %9) ({ -// CHECK-NEXT: ^3(%15 : index): -// CHECK-NEXT: %16 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %17 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %18 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %19 = "arith.addi"(%13, %16) : (index, index) -> index -// CHECK-NEXT: %20 = "arith.addi"(%14, %17) : (index, index) -> index -// CHECK-NEXT: %21 = "arith.addi"(%15, %18) : (index, index) -> index -// CHECK-NEXT: %22 = "memref.load"(%7, %19, %20, %21) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 -// CHECK-NEXT: %23 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %24 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %25 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %26 = "arith.addi"(%13, %23) : (index, index) -> index -// CHECK-NEXT: %27 = "arith.addi"(%14, %24) : (index, index) -> index -// CHECK-NEXT: %28 = "arith.addi"(%15, %25) : (index, index) -> index -// CHECK-NEXT: %29 = "memref.load"(%7, %26, %27, %28) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 -// CHECK-NEXT: %30 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %31 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %32 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %33 = "arith.addi"(%13, %30) : (index, index) -> index -// CHECK-NEXT: %34 = "arith.addi"(%14, %31) : (index, index) -> index -// CHECK-NEXT: %35 = "arith.addi"(%15, %32) : (index, index) -> index -// CHECK-NEXT: %36 = "memref.load"(%7, %33, %34, %35) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 -// CHECK-NEXT: %37 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %38 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %39 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %40 = "arith.addi"(%13, %37) : (index, index) -> index -// CHECK-NEXT: %41 = "arith.addi"(%14, %38) : (index, index) -> index -// CHECK-NEXT: %42 = "arith.addi"(%15, %39) : (index, index) -> index -// CHECK-NEXT: %43 = "memref.load"(%7, %40, %41, %42) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 -// CHECK-NEXT: %44 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %45 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %46 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %47 = "arith.addi"(%13, %44) : (index, index) -> index -// CHECK-NEXT: %48 = "arith.addi"(%14, %45) : (index, index) -> index -// CHECK-NEXT: %49 = "arith.addi"(%15, %46) : (index, index) -> index -// CHECK-NEXT: %50 = "memref.load"(%7, %47, %48, %49) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 -// CHECK-NEXT: %51 = "arith.addf"(%22, %29) : (f64, f64) -> f64 -// CHECK-NEXT: %52 = "arith.addf"(%36, %43) : (f64, f64) -> f64 -// CHECK-NEXT: %53 = "arith.addf"(%51, %52) : (f64, f64) -> f64 -// CHECK-NEXT: %cst = "arith.constant"() {"value" = -4.0 : f64} : () -> f64 -// CHECK-NEXT: %54 = "arith.mulf"(%50, %cst) : (f64, f64) -> f64 -// CHECK-NEXT: %55 = "arith.addf"(%54, %53) : (f64, f64) -> f64 -// CHECK-NEXT: "memref.store"(%55, %5, %13, %14, %15) : (f64, memref<64x64x64xf64, strided<[5184, 72, 1], offset: 21028>>, index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"function_type" = (memref, memref, memref) -> (), "sym_name" = "stencil_hdiff"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/heat_stencil_inference_ll.mlir b/tests/filecheck/dialects/stencil/heat_stencil_inference_ll.mlir deleted file mode 100644 index 53b0e90d4d..0000000000 --- a/tests/filecheck/dialects/stencil/heat_stencil_inference_ll.mlir +++ /dev/null @@ -1,419 +0,0 @@ -// RUN: xdsl-opt %s -p stencil-shape-inference,convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%data : memref<2xmemref>): - %time_m = "arith.constant"() {"value" = 0 : index} : () -> index - %time_M = "arith.constant"() {"value" = 1000 : index} : () -> index - %step = "arith.constant"() {"value" = 1 : index} : () -> index - %0 = "arith.constant"() {"value" = 1 : index} : () -> index - %time_M_1 = "arith.addi"(%time_M, %0) : (index, index) -> index - "scf.for"(%time_m, %time_M_1, %step) ({ - ^1(%time : index): - %time_1 = "arith.index_cast"(%time) : (index) -> i64 - %1 = "arith.constant"() {"value" = 2 : i64} : () -> i64 - %2 = "arith.constant"() {"value" = 0 : i64} : () -> i64 - %3 = "arith.addi"(%time_1, %2) : (i64, i64) -> i64 - %t0 = "arith.remsi"(%3, %1) : (i64, i64) -> i64 - %4 = "arith.constant"() {"value" = 1 : i64} : () -> i64 - %5 = "arith.addi"(%time_1, %4) : (i64, i64) -> i64 - %t1 = "arith.remsi"(%5, %1) : (i64, i64) -> i64 - %t0_w_size = "arith.index_cast"(%t0) : (i64) -> index - %t0_w_size_1 = "memref.load"(%data, %t0_w_size) : (memref<2xmemref>, index) -> memref - %t0_w_size_2 = "stencil.external_load"(%t0_w_size_1) : (memref) -> !stencil.field - %t0_w_size_3 = "stencil.cast"(%t0_w_size_2) : (!stencil.field) -> !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32> - %t1_w_size = "arith.index_cast"(%t1) : (i64) -> index - %t1_w_size_1 = "memref.load"(%data, %t1_w_size) : (memref<2xmemref>, index) -> memref - %t1_w_size_2 = "stencil.external_load"(%t1_w_size_1) : (memref) -> !stencil.field - %t1_w_size_3 = "stencil.cast"(%t1_w_size_2) : (!stencil.field) -> !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32> - %6 = "stencil.load"(%t0_w_size_3) : (!stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>) -> !stencil.temp - %7 = "stencil.apply"(%6) ({ - ^2(%t0_buff : !stencil.temp): - %8 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<0, 0, 0>} : (!stencil.temp) -> f32 - %9 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<-1, 0, 0>} : (!stencil.temp) -> f32 - %10 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<1, 0, 0>} : (!stencil.temp) -> f32 - %11 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<-2, 0, 0>} : (!stencil.temp) -> f32 - %12 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<2, 0, 0>} : (!stencil.temp) -> f32 - %13 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<0, -1, 0>} : (!stencil.temp) -> f32 - %14 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<0, 1, 0>} : (!stencil.temp) -> f32 - %15 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<0, -2, 0>} : (!stencil.temp) -> f32 - %16 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<0, 2, 0>} : (!stencil.temp) -> f32 - %17 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<0, 0, -1>} : (!stencil.temp) -> f32 - %18 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<0, 0, 1>} : (!stencil.temp) -> f32 - %19 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<0, 0, -2>} : (!stencil.temp) -> f32 - %20 = "stencil.access"(%t0_buff) {"offset" = #stencil.index<0, 0, 2>} : (!stencil.temp) -> f32 - %dt = "arith.constant"() {"value" = 4.122440608513459e-06 : f32} : () -> f32 - %21 = "arith.constant"() {"value" = -1 : i64} : () -> i64 - %22 = "math.fpowi"(%dt, %21) : (f32, i64) -> f32 - %23 = "arith.mulf"(%22, %8) : (f32, f32) -> f32 - %24 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 - %h_x = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %25 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %26 = "math.fpowi"(%h_x, %25) : (f32, i64) -> f32 - %27 = "arith.mulf"(%24, %26) : (f32, f32) -> f32 - %28 = "arith.mulf"(%27, %9) : (f32, f32) -> f32 - %29 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 - %h_x_1 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %30 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %31 = "math.fpowi"(%h_x_1, %30) : (f32, i64) -> f32 - %32 = "arith.mulf"(%29, %31) : (f32, f32) -> f32 - %33 = "arith.mulf"(%32, %10) : (f32, f32) -> f32 - %34 = "arith.constant"() {"value" = -2.5 : f32} : () -> f32 - %h_x_2 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %35 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %36 = "math.fpowi"(%h_x_2, %35) : (f32, i64) -> f32 - %37 = "arith.mulf"(%34, %36) : (f32, f32) -> f32 - %38 = "arith.mulf"(%37, %8) : (f32, f32) -> f32 - %39 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 - %h_x_3 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %40 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %41 = "math.fpowi"(%h_x_3, %40) : (f32, i64) -> f32 - %42 = "arith.mulf"(%39, %41) : (f32, f32) -> f32 - %43 = "arith.mulf"(%42, %11) : (f32, f32) -> f32 - %44 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 - %h_x_4 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %45 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %46 = "math.fpowi"(%h_x_4, %45) : (f32, i64) -> f32 - %47 = "arith.mulf"(%44, %46) : (f32, f32) -> f32 - %48 = "arith.mulf"(%47, %12) : (f32, f32) -> f32 - %49 = "arith.addf"(%28, %33) : (f32, f32) -> f32 - %50 = "arith.addf"(%49, %38) : (f32, f32) -> f32 - %51 = "arith.addf"(%50, %43) : (f32, f32) -> f32 - %52 = "arith.addf"(%51, %48) : (f32, f32) -> f32 - %53 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 - %h_y = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %54 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %55 = "math.fpowi"(%h_y, %54) : (f32, i64) -> f32 - %56 = "arith.mulf"(%53, %55) : (f32, f32) -> f32 - %57 = "arith.mulf"(%56, %13) : (f32, f32) -> f32 - %58 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 - %h_y_1 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %59 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %60 = "math.fpowi"(%h_y_1, %59) : (f32, i64) -> f32 - %61 = "arith.mulf"(%58, %60) : (f32, f32) -> f32 - %62 = "arith.mulf"(%61, %14) : (f32, f32) -> f32 - %63 = "arith.constant"() {"value" = -2.5 : f32} : () -> f32 - %h_y_2 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %64 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %65 = "math.fpowi"(%h_y_2, %64) : (f32, i64) -> f32 - %66 = "arith.mulf"(%63, %65) : (f32, f32) -> f32 - %67 = "arith.mulf"(%66, %8) : (f32, f32) -> f32 - %68 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 - %h_y_3 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %69 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %70 = "math.fpowi"(%h_y_3, %69) : (f32, i64) -> f32 - %71 = "arith.mulf"(%68, %70) : (f32, f32) -> f32 - %72 = "arith.mulf"(%71, %15) : (f32, f32) -> f32 - %73 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 - %h_y_4 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %74 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %75 = "math.fpowi"(%h_y_4, %74) : (f32, i64) -> f32 - %76 = "arith.mulf"(%73, %75) : (f32, f32) -> f32 - %77 = "arith.mulf"(%76, %16) : (f32, f32) -> f32 - %78 = "arith.addf"(%57, %62) : (f32, f32) -> f32 - %79 = "arith.addf"(%78, %67) : (f32, f32) -> f32 - %80 = "arith.addf"(%79, %72) : (f32, f32) -> f32 - %81 = "arith.addf"(%80, %77) : (f32, f32) -> f32 - %82 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 - %h_z = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %83 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %84 = "math.fpowi"(%h_z, %83) : (f32, i64) -> f32 - %85 = "arith.mulf"(%82, %84) : (f32, f32) -> f32 - %86 = "arith.mulf"(%85, %17) : (f32, f32) -> f32 - %87 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 - %h_z_1 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %88 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %89 = "math.fpowi"(%h_z_1, %88) : (f32, i64) -> f32 - %90 = "arith.mulf"(%87, %89) : (f32, f32) -> f32 - %91 = "arith.mulf"(%90, %18) : (f32, f32) -> f32 - %92 = "arith.constant"() {"value" = -2.5 : f32} : () -> f32 - %h_z_2 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %93 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %94 = "math.fpowi"(%h_z_2, %93) : (f32, i64) -> f32 - %95 = "arith.mulf"(%92, %94) : (f32, f32) -> f32 - %96 = "arith.mulf"(%95, %8) : (f32, f32) -> f32 - %97 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 - %h_z_3 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %98 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %99 = "math.fpowi"(%h_z_3, %98) : (f32, i64) -> f32 - %100 = "arith.mulf"(%97, %99) : (f32, f32) -> f32 - %101 = "arith.mulf"(%100, %19) : (f32, f32) -> f32 - %102 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 - %h_z_4 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 - %103 = "arith.constant"() {"value" = -2 : i64} : () -> i64 - %104 = "math.fpowi"(%h_z_4, %103) : (f32, i64) -> f32 - %105 = "arith.mulf"(%102, %104) : (f32, f32) -> f32 - %106 = "arith.mulf"(%105, %20) : (f32, f32) -> f32 - %107 = "arith.addf"(%86, %91) : (f32, f32) -> f32 - %108 = "arith.addf"(%107, %96) : (f32, f32) -> f32 - %109 = "arith.addf"(%108, %101) : (f32, f32) -> f32 - %110 = "arith.addf"(%109, %106) : (f32, f32) -> f32 - %111 = "arith.addf"(%52, %81) : (f32, f32) -> f32 - %112 = "arith.addf"(%111, %110) : (f32, f32) -> f32 - %a = "arith.constant"() {"value" = 0.5 : f32} : () -> f32 - %113 = "arith.mulf"(%112, %a) : (f32, f32) -> f32 - %114 = "arith.addf"(%23, %113) : (f32, f32) -> f32 - %dt_1 = "arith.constant"() {"value" = 4.122440608513459e-06 : f32} : () -> f32 - %115 = "arith.mulf"(%114, %dt_1) : (f32, f32) -> f32 - "stencil.return"(%115) : (f32) -> () - }) : (!stencil.temp) -> !stencil.temp - "stencil.store"(%7, %t1_w_size_3) {"lb" = #stencil.index<0, 0, 0>, "ub" = #stencil.index<50, 80, 40>} : (!stencil.temp, !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>) -> () - "scf.yield"() : () -> () - }) : (index, index, index) -> () - "func.return"() : () -> () - }) {"sym_name" = "myfunc", "function_type" = (memref<2xmemref>) -> (), "sym_visibility" = "private", "param_names" = ["data"]} : () -> () -}) : () -> () - -// CHECK: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%data : memref<2xmemref>): -// CHECK-NEXT: %time_m = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %time_M = "arith.constant"() {"value" = 1000 : index} : () -> index -// CHECK-NEXT: %step = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %0 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %time_M_1 = "arith.addi"(%time_M, %0) : (index, index) -> index -// CHECK-NEXT: "scf.for"(%time_m, %time_M_1, %step) ({ -// CHECK-NEXT: ^1(%time : index): -// CHECK-NEXT: %time_1 = "arith.index_cast"(%time) : (index) -> i64 -// CHECK-NEXT: %1 = "arith.constant"() {"value" = 2 : i64} : () -> i64 -// CHECK-NEXT: %2 = "arith.constant"() {"value" = 0 : i64} : () -> i64 -// CHECK-NEXT: %3 = "arith.addi"(%time_1, %2) : (i64, i64) -> i64 -// CHECK-NEXT: %t0 = "arith.remsi"(%3, %1) : (i64, i64) -> i64 -// CHECK-NEXT: %4 = "arith.constant"() {"value" = 1 : i64} : () -> i64 -// CHECK-NEXT: %5 = "arith.addi"(%time_1, %4) : (i64, i64) -> i64 -// CHECK-NEXT: %t1 = "arith.remsi"(%5, %1) : (i64, i64) -> i64 -// CHECK-NEXT: %t0_w_size = "arith.index_cast"(%t0) : (i64) -> index -// CHECK-NEXT: %t0_w_size_1 = "memref.load"(%data, %t0_w_size) : (memref<2xmemref>, index) -> memref -// CHECK-NEXT: %t0_w_size_3 = "memref.cast"(%t0_w_size_1) : (memref) -> memref<58x88x48xf32> -// CHECK-NEXT: %t1_w_size = "arith.index_cast"(%t1) : (i64) -> index -// CHECK-NEXT: %t1_w_size_1 = "memref.load"(%data, %t1_w_size) : (memref<2xmemref>, index) -> memref -// CHECK-NEXT: %t1_w_size_3 = "memref.cast"(%t1_w_size_1) : (memref) -> memref<58x88x48xf32> -// CHECK-NEXT: %t1_w_size_3_storeview = "memref.subview"(%t1_w_size_3) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<58x88x48xf32>) -> memref<50x80x40xf32, strided<[4224, 48, 1], offset: 17092>> -// CHECK-NEXT: %t0_w_size_3_loadview = "memref.subview"(%t0_w_size_3) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<58x88x48xf32>) -> memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>> -// CHECK-NEXT: %6 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %7 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %8 = "arith.constant"() {"value" = 50 : index} : () -> index -// CHECK-NEXT: %9 = "arith.constant"() {"value" = 80 : index} : () -> index -// CHECK-NEXT: %10 = "arith.constant"() {"value" = 40 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%6, %8, %7) ({ -// CHECK-NEXT: ^2(%11 : index): -// CHECK-NEXT: "scf.for"(%6, %9, %7) ({ -// CHECK-NEXT: ^3(%12 : index): -// CHECK-NEXT: "scf.for"(%6, %10, %7) ({ -// CHECK-NEXT: ^4(%13 : index): -// CHECK-NEXT: %14 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %15 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %16 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %17 = "arith.addi"(%11, %14) : (index, index) -> index -// CHECK-NEXT: %18 = "arith.addi"(%12, %15) : (index, index) -> index -// CHECK-NEXT: %19 = "arith.addi"(%13, %16) : (index, index) -> index -// CHECK-NEXT: %20 = "memref.load"(%t0_w_size_3_loadview, %17, %18, %19) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %21 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %22 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %23 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %24 = "arith.addi"(%11, %21) : (index, index) -> index -// CHECK-NEXT: %25 = "arith.addi"(%12, %22) : (index, index) -> index -// CHECK-NEXT: %26 = "arith.addi"(%13, %23) : (index, index) -> index -// CHECK-NEXT: %27 = "memref.load"(%t0_w_size_3_loadview, %24, %25, %26) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %28 = "arith.constant"() {"value" = 3 : index} : () -> index -// CHECK-NEXT: %29 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %30 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %31 = "arith.addi"(%11, %28) : (index, index) -> index -// CHECK-NEXT: %32 = "arith.addi"(%12, %29) : (index, index) -> index -// CHECK-NEXT: %33 = "arith.addi"(%13, %30) : (index, index) -> index -// CHECK-NEXT: %34 = "memref.load"(%t0_w_size_3_loadview, %31, %32, %33) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %35 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %36 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %37 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %38 = "arith.addi"(%11, %35) : (index, index) -> index -// CHECK-NEXT: %39 = "arith.addi"(%12, %36) : (index, index) -> index -// CHECK-NEXT: %40 = "arith.addi"(%13, %37) : (index, index) -> index -// CHECK-NEXT: %41 = "memref.load"(%t0_w_size_3_loadview, %38, %39, %40) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %42 = "arith.constant"() {"value" = 4 : index} : () -> index -// CHECK-NEXT: %43 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %44 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %45 = "arith.addi"(%11, %42) : (index, index) -> index -// CHECK-NEXT: %46 = "arith.addi"(%12, %43) : (index, index) -> index -// CHECK-NEXT: %47 = "arith.addi"(%13, %44) : (index, index) -> index -// CHECK-NEXT: %48 = "memref.load"(%t0_w_size_3_loadview, %45, %46, %47) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %49 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %50 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %51 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %52 = "arith.addi"(%11, %49) : (index, index) -> index -// CHECK-NEXT: %53 = "arith.addi"(%12, %50) : (index, index) -> index -// CHECK-NEXT: %54 = "arith.addi"(%13, %51) : (index, index) -> index -// CHECK-NEXT: %55 = "memref.load"(%t0_w_size_3_loadview, %52, %53, %54) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %56 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %57 = "arith.constant"() {"value" = 3 : index} : () -> index -// CHECK-NEXT: %58 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %59 = "arith.addi"(%11, %56) : (index, index) -> index -// CHECK-NEXT: %60 = "arith.addi"(%12, %57) : (index, index) -> index -// CHECK-NEXT: %61 = "arith.addi"(%13, %58) : (index, index) -> index -// CHECK-NEXT: %62 = "memref.load"(%t0_w_size_3_loadview, %59, %60, %61) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %63 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %64 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %65 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %66 = "arith.addi"(%11, %63) : (index, index) -> index -// CHECK-NEXT: %67 = "arith.addi"(%12, %64) : (index, index) -> index -// CHECK-NEXT: %68 = "arith.addi"(%13, %65) : (index, index) -> index -// CHECK-NEXT: %69 = "memref.load"(%t0_w_size_3_loadview, %66, %67, %68) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %70 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %71 = "arith.constant"() {"value" = 4 : index} : () -> index -// CHECK-NEXT: %72 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %73 = "arith.addi"(%11, %70) : (index, index) -> index -// CHECK-NEXT: %74 = "arith.addi"(%12, %71) : (index, index) -> index -// CHECK-NEXT: %75 = "arith.addi"(%13, %72) : (index, index) -> index -// CHECK-NEXT: %76 = "memref.load"(%t0_w_size_3_loadview, %73, %74, %75) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %77 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %78 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %79 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %80 = "arith.addi"(%11, %77) : (index, index) -> index -// CHECK-NEXT: %81 = "arith.addi"(%12, %78) : (index, index) -> index -// CHECK-NEXT: %82 = "arith.addi"(%13, %79) : (index, index) -> index -// CHECK-NEXT: %83 = "memref.load"(%t0_w_size_3_loadview, %80, %81, %82) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %84 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %85 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %86 = "arith.constant"() {"value" = 3 : index} : () -> index -// CHECK-NEXT: %87 = "arith.addi"(%11, %84) : (index, index) -> index -// CHECK-NEXT: %88 = "arith.addi"(%12, %85) : (index, index) -> index -// CHECK-NEXT: %89 = "arith.addi"(%13, %86) : (index, index) -> index -// CHECK-NEXT: %90 = "memref.load"(%t0_w_size_3_loadview, %87, %88, %89) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %91 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %92 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %93 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %94 = "arith.addi"(%11, %91) : (index, index) -> index -// CHECK-NEXT: %95 = "arith.addi"(%12, %92) : (index, index) -> index -// CHECK-NEXT: %96 = "arith.addi"(%13, %93) : (index, index) -> index -// CHECK-NEXT: %97 = "memref.load"(%t0_w_size_3_loadview, %94, %95, %96) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %98 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %99 = "arith.constant"() {"value" = 2 : index} : () -> index -// CHECK-NEXT: %100 = "arith.constant"() {"value" = 4 : index} : () -> index -// CHECK-NEXT: %101 = "arith.addi"(%11, %98) : (index, index) -> index -// CHECK-NEXT: %102 = "arith.addi"(%12, %99) : (index, index) -> index -// CHECK-NEXT: %103 = "arith.addi"(%13, %100) : (index, index) -> index -// CHECK-NEXT: %104 = "memref.load"(%t0_w_size_3_loadview, %101, %102, %103) : (memref<54x84x44xf32, strided<[4224, 48, 1], offset: 8546>>, index, index, index) -> f32 -// CHECK-NEXT: %dt = "arith.constant"() {"value" = 4.122440608513459e-06 : f32} : () -> f32 -// CHECK-NEXT: %105 = "arith.constant"() {"value" = -1 : i64} : () -> i64 -// CHECK-NEXT: %106 = "math.fpowi"(%dt, %105) : (f32, i64) -> f32 -// CHECK-NEXT: %107 = "arith.mulf"(%106, %20) : (f32, f32) -> f32 -// CHECK-NEXT: %108 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 -// CHECK-NEXT: %h_x = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %109 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %110 = "math.fpowi"(%h_x, %109) : (f32, i64) -> f32 -// CHECK-NEXT: %111 = "arith.mulf"(%108, %110) : (f32, f32) -> f32 -// CHECK-NEXT: %112 = "arith.mulf"(%111, %27) : (f32, f32) -> f32 -// CHECK-NEXT: %113 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 -// CHECK-NEXT: %h_x_1 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %114 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %115 = "math.fpowi"(%h_x_1, %114) : (f32, i64) -> f32 -// CHECK-NEXT: %116 = "arith.mulf"(%113, %115) : (f32, f32) -> f32 -// CHECK-NEXT: %117 = "arith.mulf"(%116, %34) : (f32, f32) -> f32 -// CHECK-NEXT: %118 = "arith.constant"() {"value" = -2.5 : f32} : () -> f32 -// CHECK-NEXT: %h_x_2 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %119 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %120 = "math.fpowi"(%h_x_2, %119) : (f32, i64) -> f32 -// CHECK-NEXT: %121 = "arith.mulf"(%118, %120) : (f32, f32) -> f32 -// CHECK-NEXT: %122 = "arith.mulf"(%121, %20) : (f32, f32) -> f32 -// CHECK-NEXT: %123 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 -// CHECK-NEXT: %h_x_3 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %124 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %125 = "math.fpowi"(%h_x_3, %124) : (f32, i64) -> f32 -// CHECK-NEXT: %126 = "arith.mulf"(%123, %125) : (f32, f32) -> f32 -// CHECK-NEXT: %127 = "arith.mulf"(%126, %41) : (f32, f32) -> f32 -// CHECK-NEXT: %128 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 -// CHECK-NEXT: %h_x_4 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %129 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %130 = "math.fpowi"(%h_x_4, %129) : (f32, i64) -> f32 -// CHECK-NEXT: %131 = "arith.mulf"(%128, %130) : (f32, f32) -> f32 -// CHECK-NEXT: %132 = "arith.mulf"(%131, %48) : (f32, f32) -> f32 -// CHECK-NEXT: %133 = "arith.addf"(%112, %117) : (f32, f32) -> f32 -// CHECK-NEXT: %134 = "arith.addf"(%133, %122) : (f32, f32) -> f32 -// CHECK-NEXT: %135 = "arith.addf"(%134, %127) : (f32, f32) -> f32 -// CHECK-NEXT: %136 = "arith.addf"(%135, %132) : (f32, f32) -> f32 -// CHECK-NEXT: %137 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 -// CHECK-NEXT: %h_y = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %138 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %139 = "math.fpowi"(%h_y, %138) : (f32, i64) -> f32 -// CHECK-NEXT: %140 = "arith.mulf"(%137, %139) : (f32, f32) -> f32 -// CHECK-NEXT: %141 = "arith.mulf"(%140, %55) : (f32, f32) -> f32 -// CHECK-NEXT: %142 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 -// CHECK-NEXT: %h_y_1 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %143 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %144 = "math.fpowi"(%h_y_1, %143) : (f32, i64) -> f32 -// CHECK-NEXT: %145 = "arith.mulf"(%142, %144) : (f32, f32) -> f32 -// CHECK-NEXT: %146 = "arith.mulf"(%145, %62) : (f32, f32) -> f32 -// CHECK-NEXT: %147 = "arith.constant"() {"value" = -2.5 : f32} : () -> f32 -// CHECK-NEXT: %h_y_2 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %148 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %149 = "math.fpowi"(%h_y_2, %148) : (f32, i64) -> f32 -// CHECK-NEXT: %150 = "arith.mulf"(%147, %149) : (f32, f32) -> f32 -// CHECK-NEXT: %151 = "arith.mulf"(%150, %20) : (f32, f32) -> f32 -// CHECK-NEXT: %152 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 -// CHECK-NEXT: %h_y_3 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %153 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %154 = "math.fpowi"(%h_y_3, %153) : (f32, i64) -> f32 -// CHECK-NEXT: %155 = "arith.mulf"(%152, %154) : (f32, f32) -> f32 -// CHECK-NEXT: %156 = "arith.mulf"(%155, %69) : (f32, f32) -> f32 -// CHECK-NEXT: %157 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 -// CHECK-NEXT: %h_y_4 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %158 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %159 = "math.fpowi"(%h_y_4, %158) : (f32, i64) -> f32 -// CHECK-NEXT: %160 = "arith.mulf"(%157, %159) : (f32, f32) -> f32 -// CHECK-NEXT: %161 = "arith.mulf"(%160, %76) : (f32, f32) -> f32 -// CHECK-NEXT: %162 = "arith.addf"(%141, %146) : (f32, f32) -> f32 -// CHECK-NEXT: %163 = "arith.addf"(%162, %151) : (f32, f32) -> f32 -// CHECK-NEXT: %164 = "arith.addf"(%163, %156) : (f32, f32) -> f32 -// CHECK-NEXT: %165 = "arith.addf"(%164, %161) : (f32, f32) -> f32 -// CHECK-NEXT: %166 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 -// CHECK-NEXT: %h_z = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %167 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %168 = "math.fpowi"(%h_z, %167) : (f32, i64) -> f32 -// CHECK-NEXT: %169 = "arith.mulf"(%166, %168) : (f32, f32) -> f32 -// CHECK-NEXT: %170 = "arith.mulf"(%169, %83) : (f32, f32) -> f32 -// CHECK-NEXT: %171 = "arith.constant"() {"value" = 1.3333333332557231 : f32} : () -> f32 -// CHECK-NEXT: %h_z_1 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %172 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %173 = "math.fpowi"(%h_z_1, %172) : (f32, i64) -> f32 -// CHECK-NEXT: %174 = "arith.mulf"(%171, %173) : (f32, f32) -> f32 -// CHECK-NEXT: %175 = "arith.mulf"(%174, %90) : (f32, f32) -> f32 -// CHECK-NEXT: %176 = "arith.constant"() {"value" = -2.5 : f32} : () -> f32 -// CHECK-NEXT: %h_z_2 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %177 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %178 = "math.fpowi"(%h_z_2, %177) : (f32, i64) -> f32 -// CHECK-NEXT: %179 = "arith.mulf"(%176, %178) : (f32, f32) -> f32 -// CHECK-NEXT: %180 = "arith.mulf"(%179, %20) : (f32, f32) -> f32 -// CHECK-NEXT: %181 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 -// CHECK-NEXT: %h_z_3 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %182 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %183 = "math.fpowi"(%h_z_3, %182) : (f32, i64) -> f32 -// CHECK-NEXT: %184 = "arith.mulf"(%181, %183) : (f32, f32) -> f32 -// CHECK-NEXT: %185 = "arith.mulf"(%184, %97) : (f32, f32) -> f32 -// CHECK-NEXT: %186 = "arith.constant"() {"value" = -0.0833333333284827 : f32} : () -> f32 -// CHECK-NEXT: %h_z_4 = "arith.constant"() {"value" = 0.020202020183205605 : f32} : () -> f32 -// CHECK-NEXT: %187 = "arith.constant"() {"value" = -2 : i64} : () -> i64 -// CHECK-NEXT: %188 = "math.fpowi"(%h_z_4, %187) : (f32, i64) -> f32 -// CHECK-NEXT: %189 = "arith.mulf"(%186, %188) : (f32, f32) -> f32 -// CHECK-NEXT: %190 = "arith.mulf"(%189, %104) : (f32, f32) -> f32 -// CHECK-NEXT: %191 = "arith.addf"(%170, %175) : (f32, f32) -> f32 -// CHECK-NEXT: %192 = "arith.addf"(%191, %180) : (f32, f32) -> f32 -// CHECK-NEXT: %193 = "arith.addf"(%192, %185) : (f32, f32) -> f32 -// CHECK-NEXT: %194 = "arith.addf"(%193, %190) : (f32, f32) -> f32 -// CHECK-NEXT: %195 = "arith.addf"(%136, %165) : (f32, f32) -> f32 -// CHECK-NEXT: %196 = "arith.addf"(%195, %194) : (f32, f32) -> f32 -// CHECK-NEXT: %a = "arith.constant"() {"value" = 0.5 : f32} : () -> f32 -// CHECK-NEXT: %197 = "arith.mulf"(%196, %a) : (f32, f32) -> f32 -// CHECK-NEXT: %198 = "arith.addf"(%107, %197) : (f32, f32) -> f32 -// CHECK-NEXT: %dt_1 = "arith.constant"() {"value" = 4.122440608513459e-06 : f32} : () -> f32 -// CHECK-NEXT: %199 = "arith.mulf"(%198, %dt_1) : (f32, f32) -> f32 -// CHECK-NEXT: "memref.store"(%199, %t1_w_size_3_storeview, %11, %12, %13) : (f32, memref<50x80x40xf32, strided<[4224, 48, 1], offset: 17092>>, index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"sym_name" = "myfunc", "function_type" = (memref<2xmemref>) -> (), "sym_visibility" = "private", "param_names" = ["data"]} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/iterate.mlir b/tests/filecheck/dialects/stencil/iterate.mlir deleted file mode 100644 index 2048cd91e3..0000000000 --- a/tests/filecheck/dialects/stencil/iterate.mlir +++ /dev/null @@ -1,61 +0,0 @@ -// RUN: xdsl-opt %s -p stencil-shape-inference,convert-stencil-to-ll-mlir | filecheck %s - -builtin.module { - func.func @bufferswapping_stencil(%f0 : !stencil.field<[-2,2002]x[-2,2002]xf32>, %f1 : !stencil.field<[-2,2002]x[-2,2002]xf32>) -> (!stencil.field<[-2,2002]x[-2,2002]xf32>) { - - %time_m = "arith.constant"() {"value" = 0 : index} : () -> index - %time_M = "arith.constant"() {"value" = 1001 : index} : () -> index - %step = "arith.constant"() {"value" = 1 : index} : () -> index - - %t1_out, %t0_out = "scf.for"(%time_m, %time_M, %step, %f0, %f1) ({ - ^1(%time : index, %fim1 : !stencil.field<[-2,2002]x[-2,2002]xf32>, %fi : !stencil.field<[-2,2002]x[-2,2002]xf32>): - - %tim1 = "stencil.load"(%fim1) : (!stencil.field<[-2,2002]x[-2,2002]xf32>) -> !stencil.temp - - %ti = "stencil.apply"(%tim1) ({ - ^2(%tim1_b : !stencil.temp): - %i = "stencil.access"(%tim1) {"offset" = #stencil.index<0,0,0>} : (!stencil.temp) -> f32 - "stencil.return"(%i) : (f32) -> () - }) : (!stencil.temp) -> !stencil.temp - - "stencil.store"(%ti, %fi) {"lb" = #stencil.index<0, 0>, "ub" = #stencil.index<2000, 2000>} : (!stencil.temp, !stencil.field<[-2,2002]x[-2,2002]xf32>) -> () - - "scf.yield"(%fi, %fim1) : (!stencil.field<[-2,2002]x[-2,2002]xf32>, !stencil.field<[-2,2002]x[-2,2002]xf32>) -> () - }) : (index, index, index, !stencil.field<[-2,2002]x[-2,2002]xf32>, !stencil.field<[-2,2002]x[-2,2002]xf32>) -> (!stencil.field<[-2,2002]x[-2,2002]xf32>, !stencil.field<[-2,2002]x[-2,2002]xf32>) - - "func.return"(%t1_out) : (!stencil.field<[-2,2002]x[-2,2002]xf32>) -> () - } -} - -// CHECK: builtin.module { -// CHECK-NEXT: func.func @bufferswapping_stencil(%f0 : memref<2004x2004xf32>, %f1 : memref<2004x2004xf32>) -> memref<2004x2004xf32> { -// CHECK-NEXT: %time_m = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %time_M = "arith.constant"() {"value" = 1001 : index} : () -> index -// CHECK-NEXT: %step = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %t1_out, %t0_out = "scf.for"(%time_m, %time_M, %step, %f0, %f1) ({ -// CHECK-NEXT: ^0(%time : index, %fim1 : memref<2004x2004xf32>, %fi : memref<2004x2004xf32>): -// CHECK-NEXT: %fi_storeview = "memref.subview"(%fi) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<2004x2004xf32>) -> memref<2000x2000xf32, strided<[2004, 1], offset: 4010>> -// CHECK-NEXT: %fim1_loadview = "memref.subview"(%fim1) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<2004x2004xf32>) -> memref<2000x2000xf32, strided<[2004, 1], offset: 4010>> -// CHECK-NEXT: %0 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %1 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %2 = "arith.constant"() {"value" = 2000 : index} : () -> index -// CHECK-NEXT: %3 = "arith.constant"() {"value" = 2000 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%0, %2, %1) ({ -// CHECK-NEXT: ^1(%4 : index): -// CHECK-NEXT: "scf.for"(%0, %3, %1) ({ -// CHECK-NEXT: ^2(%5 : index): -// CHECK-NEXT: %i = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %i_1 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %i_2 = arith.addi %4, %i : index -// CHECK-NEXT: %i_3 = arith.addi %5, %i_1 : index -// CHECK-NEXT: %i_4 = "memref.load"(%fim1_loadview, %i_2, %i_3) : (memref<2000x2000xf32, strided<[2004, 1], offset: 4010>>, index, index) -> f32 -// CHECK-NEXT: "memref.store"(%i_4, %fi_storeview, %4, %5) : (f32, memref<2000x2000xf32, strided<[2004, 1], offset: 4010>>, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"(%fi, %fim1) : (memref<2004x2004xf32>, memref<2004x2004xf32>) -> () -// CHECK-NEXT: }) : (index, index, index, memref<2004x2004xf32>, memref<2004x2004xf32>) -> (memref<2004x2004xf32>, memref<2004x2004xf32>) -// CHECK-NEXT: "func.return"(%t1_out) : (memref<2004x2004xf32>) -> () -// CHECK-NEXT: } -// CHECK-NEXT: } diff --git a/tests/filecheck/dialects/stencil/stencil_apply_float_arg.mlir b/tests/filecheck/dialects/stencil/stencil_apply_float_arg.mlir deleted file mode 100644 index 5bba8cb4fa..0000000000 --- a/tests/filecheck/dialects/stencil/stencil_apply_float_arg.mlir +++ /dev/null @@ -1,84 +0,0 @@ -// RUN: xdsl-opt %s -p stencil-shape-inference,convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : f64, %1 : !stencil.field): - %2 = "stencil.cast"(%1) : (!stencil.field) -> !stencil.field<[-3,67]x[-3,67]x[-3,67]xf64> - %3 = "stencil.apply"(%0) ({ - ^1(%4 : f64): - %5 = "arith.constant"() {"value" = 1.0 : f64} : () -> f64 - %6 = "arith.addf"(%4, %5) : (f64, f64) -> f64 - "stencil.return"(%6) : (!stencil.result) -> () - }) : (f64) -> !stencil.temp - "stencil.store"(%3, %2) {"lb" = #stencil.index<1, 2, 3>, "ub" = #stencil.index<65, 66, 63>} : (!stencil.temp, !stencil.field<[1,65]x[2,66]x[3,63]xf64>) -> () - "func.return"() : () -> () - }) {"function_type" = (f64, !stencil.field) -> (), "sym_name" = "stencil_float64_arg"} : () -> () - - "func.func"() ({ - ^2(%7 : f32, %8 : !stencil.field): - %9 = "stencil.cast"(%8) : (!stencil.field) -> !stencil.field<[-3,67]x[-3,67]x[-3,67]xf32> - %10 = "stencil.apply"(%7) ({ - ^3(%11 : f32): - %12 = "arith.constant"() {"value" = 1.0 : f32} : () -> f32 - %13 = "arith.addf"(%11, %12) : (f32, f32) -> f32 - "stencil.return"(%13) : (f32) -> () - }) : (f32) -> !stencil.temp - "stencil.store"(%10, %9) {"lb" = #stencil.index<1, 2, 3>, "ub" = #stencil.index<65, 66, 63>} : (!stencil.temp, !stencil.field<[-3,67]x[-3,67]x[-3,67]xf32>) -> () - "func.return"() : () -> () - }) {"function_type" = (f32, !stencil.field) -> (), "sym_name" = "stencil_float32_arg"} : () -> () -}) : () -> () - -// CHECK: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : f64, %1 : memref): -// CHECK-NEXT: %2 = "memref.cast"(%1) : (memref) -> memref<70x70x70xf64> -// CHECK-NEXT: %3 = "memref.subview"(%2) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<70x70x70xf64>) -> memref<64x64x60xf64, strided<[4900, 70, 1], offset: 19956>> -// CHECK-NEXT: %4 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %5 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %6 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %7 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %8 = "arith.constant"() {"value" = 60 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%4, %6, %5) ({ -// CHECK-NEXT: ^1(%9 : index): -// CHECK-NEXT: "scf.for"(%4, %7, %5) ({ -// CHECK-NEXT: ^2(%10 : index): -// CHECK-NEXT: "scf.for"(%4, %8, %5) ({ -// CHECK-NEXT: ^3(%11 : index): -// CHECK-NEXT: %12 = "arith.constant"() {"value" = 1.0 : f64} : () -> f64 -// CHECK-NEXT: %13 = "arith.addf"(%0, %12) : (f64, f64) -> f64 -// CHECK-NEXT: "memref.store"(%13, %3, %9, %10, %11) : (f64, memref<64x64x60xf64, strided<[4900, 70, 1], offset: 19956>>, index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"function_type" = (f64, memref) -> (), "sym_name" = "stencil_float64_arg"} : () -> () -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^4(%14 : f32, %15 : memref): -// CHECK-NEXT: %16 = "memref.cast"(%15) : (memref) -> memref<70x70x70xf32> -// CHECK-NEXT: %17 = "memref.subview"(%16) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<70x70x70xf32>) -> memref<64x64x60xf32, strided<[4900, 70, 1], offset: 19956>> -// CHECK-NEXT: %18 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %19 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %20 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %21 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %22 = "arith.constant"() {"value" = 60 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%18, %20, %19) ({ -// CHECK-NEXT: ^5(%23 : index): -// CHECK-NEXT: "scf.for"(%18, %21, %19) ({ -// CHECK-NEXT: ^6(%24 : index): -// CHECK-NEXT: "scf.for"(%18, %22, %19) ({ -// CHECK-NEXT: ^7(%25 : index): -// CHECK-NEXT: %26 = "arith.constant"() {"value" = 1.0 : f32} : () -> f32 -// CHECK-NEXT: %27 = "arith.addf"(%14, %26) : (f32, f32) -> f32 -// CHECK-NEXT: "memref.store"(%27, %17, %23, %24, %25) : (f32, memref<64x64x60xf32, strided<[4900, 70, 1], offset: 19956>>, index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"function_type" = (f32, memref) -> (), "sym_name" = "stencil_float32_arg"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/test_access_lowering_1d.mlir b/tests/filecheck/dialects/stencil/test_access_lowering_1d.mlir deleted file mode 100644 index c0126828a0..0000000000 --- a/tests/filecheck/dialects/stencil/test_access_lowering_1d.mlir +++ /dev/null @@ -1,34 +0,0 @@ -// RUN: xdsl-opt %s -p convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : !stencil.field): - %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]xf64> - %2 = "stencil.load"(%1) : (!stencil.field) -> !stencil.temp<[-4,68]xf64> - %5 = "stencil.apply"(%2) ({ - ^b0(%3: !stencil.temp<[-4,68]xf64>): - %4 = "stencil.access"(%3) {"offset" = #stencil.index<-1, 0, 1>} : (!stencil.temp<[-4,68]xf64>) -> f64 - "stencil.return"(%4) : (f64) -> () - }) : (!stencil.temp<[-4,68]xf64>) -> (!stencil.temp<[0,68]xf64>) - "func.return"() : () -> () - }) {"sym_name" = "test_funcop_lowering", "function_type" = (!stencil.field) -> (), "sym_visibility" = "private"} : () -> () -}) : () -> () - -// CHECK: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : memref): -// CHECK-NEXT: %1 = "memref.cast"(%0) : (memref) -> memref<72xf64> -// CHECK-NEXT: %2 = "memref.subview"(%1) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72xf64>) -> memref<72xf64, strided<[1]>> -// CHECK-NEXT: %3 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %4 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %5 = "arith.constant"() {"value" = 68 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%3, %5, %4) ({ -// CHECK-NEXT: ^1(%6 : index): -// CHECK-NEXT: %7 = "arith.constant"() {"value" = 3 : index} : () -> index -// CHECK-NEXT: %8 = "arith.addi"(%6, %7) : (index, index) -> index -// CHECK-NEXT: %9 = "memref.load"(%2, %8) : (memref<72xf64, strided<[1]>>, index) -> f64 -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"sym_name" = "test_funcop_lowering", "function_type" = (memref) -> (), "sym_visibility" = "private"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/test_access_lowering_2d.mlir b/tests/filecheck/dialects/stencil/test_access_lowering_2d.mlir deleted file mode 100644 index e9a764cff3..0000000000 --- a/tests/filecheck/dialects/stencil/test_access_lowering_2d.mlir +++ /dev/null @@ -1,41 +0,0 @@ -// RUN: xdsl-opt %s -p convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : !stencil.field): - %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]xf64> - %2 = "stencil.load"(%1) : (!stencil.field<[-4,68]x[-4,68]xf64>) -> !stencil.temp<[-4,68]x[-4,68]xf64> - %5 = "stencil.apply"(%2) ({ - ^b0(%3: !stencil.temp<[-1,64]x[0,68]xf64>): - %4 = "stencil.access"(%3) {"offset" = #stencil.index<-1, 0>} : (!stencil.temp<[-1,64]x[0,68]xf64>) -> f64 - "stencil.return"(%4) : (f64) -> () - }) : (!stencil.temp<[0,64]x[0,68]xf64>) -> (!stencil.temp<[0,64]x[0,68]xf64>) - "func.return"() : () -> () - }) {"sym_name" = "test_funcop_lowering", "function_type" = (!stencil.field) -> (), "sym_visibility" = "private"} : () -> () -}) : () -> () - -// CHECK: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : memref): -// CHECK-NEXT: %1 = "memref.cast"(%0) : (memref) -> memref<72x72xf64> -// CHECK-NEXT: %2 = "memref.subview"(%1) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72xf64>) -> memref<72x72xf64, strided<[72, 1]>> -// CHECK-NEXT: %3 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %4 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %5 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %6 = "arith.constant"() {"value" = 68 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%3, %5, %4) ({ -// CHECK-NEXT: ^1(%7 : index): -// CHECK-NEXT: "scf.for"(%3, %6, %4) ({ -// CHECK-NEXT: ^2(%8 : index): -// CHECK-NEXT: %9 = "arith.constant"() {"value" = 3 : index} : () -> index -// CHECK-NEXT: %10 = "arith.constant"() {"value" = 4 : index} : () -> index -// CHECK-NEXT: %11 = "arith.addi"(%7, %9) : (index, index) -> index -// CHECK-NEXT: %12 = "arith.addi"(%8, %10) : (index, index) -> index -// CHECK-NEXT: %13 = "memref.load"(%2, %11, %12) : (memref<72x72xf64, strided<[72, 1]>>, index, index) -> f64 -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"sym_name" = "test_funcop_lowering", "function_type" = (memref) -> (), "sym_visibility" = "private"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/test_access_lowering_3d.mlir b/tests/filecheck/dialects/stencil/test_access_lowering_3d.mlir deleted file mode 100644 index a65af49126..0000000000 --- a/tests/filecheck/dialects/stencil/test_access_lowering_3d.mlir +++ /dev/null @@ -1,48 +0,0 @@ -// RUN: xdsl-opt %s -p convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : !stencil.field): - %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,70]x[-4,72]xf64> - %2 = "stencil.load"(%1) : (!stencil.field<[-4,68]x[-4,70]x[-4,72]xf64>) -> !stencil.temp<[-4,68]x[-4,70]x[-4,72]xf64> - %5 = "stencil.apply"(%2) ({ - ^b0(%3: !stencil.temp<[-4,68]x[-4,70]x[-4,72]xf64>): - %4 = "stencil.access"(%3) {"offset" = #stencil.index<-1, 0, 1>} : (!stencil.temp<[-4,68]x[-4,70]x[-4,72]xf64>) -> f64 - "stencil.return"(%4) : (f64) -> () - }) : (!stencil.temp<[-4,68]x[-4,70]x[-4,72]xf64>) -> (!stencil.temp<[0,64]x[0,64]x[0,68]xf64>) - "func.return"() : () -> () - }) {"sym_name" = "test_funcop_lowering", "function_type" = (!stencil.field) -> (), "sym_visibility" = "private"} : () -> () -}) : () -> () - -// CHECK: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : memref): -// CHECK-NEXT: %1 = "memref.cast"(%0) : (memref) -> memref<72x74x76xf64> -// CHECK-NEXT: %2 = "memref.subview"(%1) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x74x76xf64>) -> memref<72x74x76xf64, strided<[5624, 76, 1]>> -// CHECK-NEXT: %3 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %4 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %5 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %6 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %7 = "arith.constant"() {"value" = 68 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%3, %5, %4) ({ -// CHECK-NEXT: ^1(%8 : index): -// CHECK-NEXT: "scf.for"(%3, %6, %4) ({ -// CHECK-NEXT: ^2(%9 : index): -// CHECK-NEXT: "scf.for"(%3, %7, %4) ({ -// CHECK-NEXT: ^3(%10 : index): -// CHECK-NEXT: %11 = "arith.constant"() {"value" = 3 : index} : () -> index -// CHECK-NEXT: %12 = "arith.constant"() {"value" = 4 : index} : () -> index -// CHECK-NEXT: %13 = "arith.constant"() {"value" = 5 : index} : () -> index -// CHECK-NEXT: %14 = "arith.addi"(%8, %11) : (index, index) -> index -// CHECK-NEXT: %15 = "arith.addi"(%9, %12) : (index, index) -> index -// CHECK-NEXT: %16 = "arith.addi"(%10, %13) : (index, index) -> index -// CHECK-NEXT: %17 = "memref.load"(%2, %14, %15, %16) : (memref<72x74x76xf64, strided<[5624, 76, 1]>>, index, index, index) -> f64 -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"sym_name" = "test_funcop_lowering", "function_type" = (memref) -> (), "sym_visibility" = "private"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/test_apply_lowering.mlir b/tests/filecheck/dialects/stencil/test_apply_lowering.mlir deleted file mode 100644 index f047301ee4..0000000000 --- a/tests/filecheck/dialects/stencil/test_apply_lowering.mlir +++ /dev/null @@ -1,42 +0,0 @@ -// RUN: xdsl-opt %s -p convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : !stencil.field): - %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> - %2 = "stencil.load"(%1) : (!stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>) -> !stencil.temp<[-4,68]x[-4,68]x[-4,68]xf64> - %5 = "stencil.apply"(%2) ({ - ^b0(%3: !stencil.temp<[-4,68]x[-4,68]x[-4,68]xf64>): - %zero = "arith.constant"() {value = 0.0 : f64} : () -> f64 - "stencil.return"(%zero) : (f64) -> () - }) : (!stencil.temp<[-4,68]x[-4,68]x[-4,68]xf64>) -> (!stencil.temp<[-4,68]x[-4,68]x[-4,68]xf64>) - "func.return"() : () -> () - }) {"sym_name" = "test_funcop_lowering", "function_type" = (!stencil.field) -> (), "sym_visibility" = "private"} : () -> () -}) : () -> () - -// CHECK: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : memref): -// CHECK-NEXT: %1 = "memref.cast"(%0) : (memref) -> memref<72x72x72xf64> -// CHECK-NEXT: %2 = "memref.subview"(%1) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72x72xf64>) -> memref<72x72x72xf64, strided<[5184, 72, 1]>> -// CHECK-NEXT: %3 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %4 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %5 = "arith.constant"() {"value" = 72 : index} : () -> index -// CHECK-NEXT: %6 = "arith.constant"() {"value" = 72 : index} : () -> index -// CHECK-NEXT: %7 = "arith.constant"() {"value" = 72 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%3, %5, %4) ({ -// CHECK-NEXT: ^1(%8 : index): -// CHECK-NEXT: "scf.for"(%3, %6, %4) ({ -// CHECK-NEXT: ^2(%9 : index): -// CHECK-NEXT: "scf.for"(%3, %7, %4) ({ -// CHECK-NEXT: ^3(%10 : index): -// CHECK-NEXT: %zero = "arith.constant"() {"value" = 0.0 : f64} : () -> f64 -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"sym_name" = "test_funcop_lowering", "function_type" = (memref) -> (), "sym_visibility" = "private"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/test_castop_lowering_1d.mlir b/tests/filecheck/dialects/stencil/test_castop_lowering_1d.mlir deleted file mode 100644 index 6e89c3be28..0000000000 --- a/tests/filecheck/dialects/stencil/test_castop_lowering_1d.mlir +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: xdsl-opt %s -p convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : !stencil.field): - %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]xf64> - "func.return"() : () -> () - }) {"sym_name" = "test_funcop_lowering", "function_type" = (!stencil.field) -> (), "sym_visibility" = "private"} : () -> () -}) : () -> () - -// CHECK-NEXT: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : memref): -// CHECK-NEXT: %1 = "memref.cast"(%0) : (memref) -> memref<72xf64> -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"sym_name" = "test_funcop_lowering", "function_type" = (memref) -> (), "sym_visibility" = "private"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/test_castop_lowering_3d.mlir b/tests/filecheck/dialects/stencil/test_castop_lowering_3d.mlir deleted file mode 100644 index df626321fa..0000000000 --- a/tests/filecheck/dialects/stencil/test_castop_lowering_3d.mlir +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: xdsl-opt %s -p convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : !stencil.field): - %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> - "func.return"() : () -> () - }) {"sym_name" = "test_funcop_lowering", "function_type" = (!stencil.field) -> (), "sym_visibility" = "private"} : () -> () -}) : () -> () - -// CHECK-NEXT: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : memref): -// CHECK-NEXT: %1 = "memref.cast"(%0) : (memref) -> memref<72x72x72xf64> -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"sym_name" = "test_funcop_lowering", "function_type" = (memref) -> (), "sym_visibility" = "private"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/test_funcop_lowering.mlir b/tests/filecheck/dialects/stencil/test_funcop_lowering.mlir deleted file mode 100644 index 32a79a7080..0000000000 --- a/tests/filecheck/dialects/stencil/test_funcop_lowering.mlir +++ /dev/null @@ -1,20 +0,0 @@ -// RUN: xdsl-opt %s -p convert-stencil-to-ll-mlir | filecheck %s - -builtin.module { - func.func @test_funcop_lowering(%0 : !stencil.field) { - "func.return"() : () -> () - } - - func.func @test_funcop_lowering(%1 : !stencil.field<[-1,7]x[-1,7]xf64>) { - "func.return"() : () -> () - } -} - -// CHECK-NEXT: builtin.module { -// CHECK-NEXT: func.func @test_funcop_lowering(%0 : memref) { -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: } -// CHECK-NEXT: func.func @test_funcop_lowering(%1 : memref<8x8xf64>) { -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: } -// CHECK-NEXT: } diff --git a/tests/filecheck/dialects/stencil/test_loadop_lowering.mlir b/tests/filecheck/dialects/stencil/test_loadop_lowering.mlir deleted file mode 100644 index fcc131acf1..0000000000 --- a/tests/filecheck/dialects/stencil/test_loadop_lowering.mlir +++ /dev/null @@ -1,19 +0,0 @@ -// RUN: xdsl-opt %s -p convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : !stencil.field): - %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> - %2 = "stencil.load"(%1) : (!stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>) -> !stencil.temp<[-4,68]x[-4,68]x[-4,68]xf64> - "func.return"() : () -> () - }) {"sym_name" = "test_funcop_lowering", "function_type" = (!stencil.field) -> (), "sym_visibility" = "private"} : () -> () -}) : () -> () - -// CHECK-NEXT: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : memref): -// CHECK-NEXT: %1 = "memref.cast"(%0) : (memref) -> memref<72x72x72xf64> -// CHECK-NEXT: %2 = "memref.subview"(%1) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72x72xf64>) -> memref<72x72x72xf64, strided<[5184, 72, 1]>> -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"sym_name" = "test_funcop_lowering", "function_type" = (memref) -> (), "sym_visibility" = "private"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/dialects/stencil/test_store_lowering.mlir b/tests/filecheck/dialects/stencil/test_store_lowering.mlir deleted file mode 100644 index 6bc6da5d7f..0000000000 --- a/tests/filecheck/dialects/stencil/test_store_lowering.mlir +++ /dev/null @@ -1,53 +0,0 @@ -// RUN: xdsl-opt %s -p stencil-shape-inference,convert-stencil-to-ll-mlir --print-op-generic | filecheck %s - -"builtin.module"() ({ - "func.func"() ({ - ^0(%0 : !stencil.field, %6 : !stencil.field): - %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> - %7 = "stencil.cast"(%6) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> - %2 = "stencil.load"(%1) : (!stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>) -> !stencil.temp - %8 = "stencil.apply"(%2) ({ - ^b0(%4: !stencil.temp): - %5 = "stencil.access"(%4) {"offset" = #stencil.index<-1, 0, 1>} : (!stencil.temp) -> f64 - "stencil.return"(%5) : (f64) -> () - }) : (!stencil.temp) -> (!stencil.temp) - "stencil.store"(%8, %7) {"lb" = #stencil.index<0, 0, 0>, "ub" = #stencil.index<64, 64, 64>} : (!stencil.temp, !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>) -> () - "func.return"() : () -> () - }) {"sym_name" = "test_funcop_lowering", "function_type" = (!stencil.field, !stencil.field) -> (), "sym_visibility" = "private"} : () -> () -}) : () -> () - -// CHECK: "builtin.module"() ({ -// CHECK-NEXT: "func.func"() ({ -// CHECK-NEXT: ^0(%0 : memref, %1 : memref): -// CHECK-NEXT: %2 = "memref.cast"(%0) : (memref) -> memref<72x72x72xf64> -// CHECK-NEXT: %3 = "memref.cast"(%1) : (memref) -> memref<72x72x72xf64> -// CHECK-NEXT: %4 = "memref.subview"(%3) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72x72xf64>) -> memref<64x64x64xf64, strided<[5184, 72, 1], offset: 21028>> -// CHECK-NEXT: %5 = "memref.subview"(%2) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72x72xf64>) -> memref<65x64x65xf64, strided<[5184, 72, 1], offset: 15844>> -// CHECK-NEXT: %6 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %7 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %8 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %9 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: %10 = "arith.constant"() {"value" = 64 : index} : () -> index -// CHECK-NEXT: "scf.parallel"(%6, %8, %7) ({ -// CHECK-NEXT: ^1(%11 : index): -// CHECK-NEXT: "scf.for"(%6, %9, %7) ({ -// CHECK-NEXT: ^2(%12 : index): -// CHECK-NEXT: "scf.for"(%6, %10, %7) ({ -// CHECK-NEXT: ^3(%13 : index): -// CHECK-NEXT: %14 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %15 = "arith.constant"() {"value" = 0 : index} : () -> index -// CHECK-NEXT: %16 = "arith.constant"() {"value" = 1 : index} : () -> index -// CHECK-NEXT: %17 = "arith.addi"(%11, %14) : (index, index) -> index -// CHECK-NEXT: %18 = "arith.addi"(%12, %15) : (index, index) -> index -// CHECK-NEXT: %19 = "arith.addi"(%13, %16) : (index, index) -> index -// CHECK-NEXT: %20 = "memref.load"(%5, %17, %18, %19) : (memref<65x64x65xf64, strided<[5184, 72, 1], offset: 15844>>, index, index, index) -> f64 -// CHECK-NEXT: "memref.store"(%20, %4, %11, %12, %13) : (f64, memref<64x64x64xf64, strided<[5184, 72, 1], offset: 21028>>, index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) : (index, index, index) -> () -// CHECK-NEXT: "scf.yield"() : () -> () -// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () -// CHECK-NEXT: "func.return"() : () -> () -// CHECK-NEXT: }) {"sym_name" = "test_funcop_lowering", "function_type" = (memref, memref) -> (), "sym_visibility" = "private"} : () -> () -// CHECK-NEXT: }) : () -> () diff --git a/tests/filecheck/transforms/convert-stencil-to-ll-mlir.mlir b/tests/filecheck/transforms/convert-stencil-to-ll-mlir.mlir new file mode 100644 index 0000000000..4dae478032 --- /dev/null +++ b/tests/filecheck/transforms/convert-stencil-to-ll-mlir.mlir @@ -0,0 +1,304 @@ +// RUN: xdsl-opt %s -p convert-stencil-to-ll-mlir | filecheck %s + +builtin.module { +// CHECK: builtin.module { + + func.func @stencil_init_float(%0 : f64, %1 : !stencil.field) { + %2 = "stencil.cast"(%1) : (!stencil.field) -> !stencil.field<[-3,67]x[-3,67]x[-3,67]xf64> + %3 = "stencil.apply"(%0) ({ + ^0(%4 : f64): + %5 = "arith.constant"() {"value" = 1.0 : f64} : () -> f64 + %6 = arith.addf %4, %5 : f64 + "stencil.return"(%6) : (f64) -> () + }) : (f64) -> !stencil.temp<[1,65]x[2,66]x[3,63]xf64> + "stencil.store"(%3, %2) {"lb" = #stencil.index<1, 2, 3>, "ub" = #stencil.index<65, 66, 63>} : (!stencil.temp<[1,65]x[2,66]x[3,63]xf64>, !stencil.field<[-3,67]x[-3,67]x[-3,67]xf64>) -> () + "func.return"() : () -> () + } + +// CHECK: func.func @stencil_init_float(%0 : f64, %1 : memref) { +// CHECK-NEXT: %2 = "memref.cast"(%1) : (memref) -> memref<70x70x70xf64> +// CHECK-NEXT: %3 = "memref.subview"(%2) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<70x70x70xf64>) -> memref<64x64x60xf64, strided<[4900, 70, 1], offset: 19956>> +// CHECK-NEXT: %4 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %5 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %6 = "arith.constant"() {"value" = 64 : index} : () -> index +// CHECK-NEXT: %7 = "arith.constant"() {"value" = 64 : index} : () -> index +// CHECK-NEXT: %8 = "arith.constant"() {"value" = 60 : index} : () -> index +// CHECK-NEXT: "scf.parallel"(%4, %6, %5) ({ +// CHECK-NEXT: ^0(%9 : index): +// CHECK-NEXT: "scf.for"(%4, %7, %5) ({ +// CHECK-NEXT: ^1(%10 : index): +// CHECK-NEXT: "scf.for"(%4, %8, %5) ({ +// CHECK-NEXT: ^2(%11 : index): +// CHECK-NEXT: %12 = "arith.constant"() {"value" = 1.0 : f64} : () -> f64 +// CHECK-NEXT: %13 = arith.addf %0, %12 : f64 +// CHECK-NEXT: "memref.store"(%13, %3, %9, %10, %11) : (f64, memref<64x64x60xf64, strided<[4900, 70, 1], offset: 19956>>, index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) : (index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) : (index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () +// CHECK-NEXT: "func.return"() : () -> () +// CHECK-NEXT: } + + func.func @bufferswapping(%f0 : !stencil.field<[-2,2002]x[-2,2002]xf32>, %f1 : !stencil.field<[-2,2002]x[-2,2002]xf32>) -> !stencil.field<[-2,2002]x[-2,2002]xf32> { + %time_m = "arith.constant"() {"value" = 0 : index} : () -> index + %time_M = "arith.constant"() {"value" = 1001 : index} : () -> index + %step = "arith.constant"() {"value" = 1 : index} : () -> index + %t1_out, %t0_out = "scf.for"(%time_m, %time_M, %step, %f0, %f1) ({ + ^1(%time : index, %fim1 : !stencil.field<[-2,2002]x[-2,2002]xf32>, %fi : !stencil.field<[-2,2002]x[-2,2002]xf32>): + %tim1 = "stencil.load"(%fim1) : (!stencil.field<[-2,2002]x[-2,2002]xf32>) -> !stencil.temp<[0,2000]x[0,2000]xf32> + %ti = "stencil.apply"(%tim1) ({ + ^2(%tim1_b : !stencil.temp<[0,2000]x[0,2000]xf32>): + %i = "stencil.access"(%tim1) {"offset" = #stencil.index<0, 0, 0>} : (!stencil.temp<[0,2000]x[0,2000]xf32>) -> f32 + "stencil.return"(%i) : (f32) -> () + }) : (!stencil.temp<[0,2000]x[0,2000]xf32>) -> !stencil.temp<[0,2000]x[0,2000]xf32> + "stencil.store"(%ti, %fi) {"lb" = #stencil.index<0, 0>, "ub" = #stencil.index<2000, 2000>} : (!stencil.temp<[0,2000]x[0,2000]xf32>, !stencil.field<[-2,2002]x[-2,2002]xf32>) -> () + "scf.yield"(%fi, %fim1) : (!stencil.field<[-2,2002]x[-2,2002]xf32>, !stencil.field<[-2,2002]x[-2,2002]xf32>) -> () + }) : (index, index, index, !stencil.field<[-2,2002]x[-2,2002]xf32>, !stencil.field<[-2,2002]x[-2,2002]xf32>) -> (!stencil.field<[-2,2002]x[-2,2002]xf32>, !stencil.field<[-2,2002]x[-2,2002]xf32>) + "func.return"(%t1_out) : (!stencil.field<[-2,2002]x[-2,2002]xf32>) -> () + } +// CHECK: func.func @bufferswapping(%f0 : memref<2004x2004xf32>, %f1 : memref<2004x2004xf32>) -> memref<2004x2004xf32> { +// CHECK-NEXT: %time_m = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %time_M = "arith.constant"() {"value" = 1001 : index} : () -> index +// CHECK-NEXT: %step = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %t1_out, %t0_out = "scf.for"(%time_m, %time_M, %step, %f0, %f1) ({ +// CHECK-NEXT: ^3(%time : index, %fim1 : memref<2004x2004xf32>, %fi : memref<2004x2004xf32>): +// CHECK-NEXT: %fi_storeview = "memref.subview"(%fi) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<2004x2004xf32>) -> memref<2000x2000xf32, strided<[2004, 1], offset: 4010>> +// CHECK-NEXT: %fim1_loadview = "memref.subview"(%fim1) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<2004x2004xf32>) -> memref<2000x2000xf32, strided<[2004, 1], offset: 4010>> +// CHECK-NEXT: %14 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %15 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %16 = "arith.constant"() {"value" = 2000 : index} : () -> index +// CHECK-NEXT: %17 = "arith.constant"() {"value" = 2000 : index} : () -> index +// CHECK-NEXT: "scf.parallel"(%14, %16, %15) ({ +// CHECK-NEXT: ^4(%18 : index): +// CHECK-NEXT: "scf.for"(%14, %17, %15) ({ +// CHECK-NEXT: ^5(%19 : index): +// CHECK-NEXT: %i = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %i_1 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %i_2 = arith.addi %18, %i : index +// CHECK-NEXT: %i_3 = arith.addi %19, %i_1 : index +// CHECK-NEXT: %i_4 = "memref.load"(%fim1_loadview, %i_2, %i_3) : (memref<2000x2000xf32, strided<[2004, 1], offset: 4010>>, index, index) -> f32 +// CHECK-NEXT: "memref.store"(%i_4, %fi_storeview, %18, %19) : (f32, memref<2000x2000xf32, strided<[2004, 1], offset: 4010>>, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) : (index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () +// CHECK-NEXT: "scf.yield"(%fi, %fim1) : (memref<2004x2004xf32>, memref<2004x2004xf32>) -> () +// CHECK-NEXT: }) : (index, index, index, memref<2004x2004xf32>, memref<2004x2004xf32>) -> (memref<2004x2004xf32>, memref<2004x2004xf32>) +// CHECK-NEXT: "func.return"(%t1_out) : (memref<2004x2004xf32>) -> () +// CHECK-NEXT: } + + func.func @copy_1d(%0 : !stencil.field, %out : !stencil.field) { + %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]xf64> + %outc = "stencil.cast"(%out) : (!stencil.field) -> !stencil.field<[0,1024]xf64> + %2 = "stencil.load"(%1) : (!stencil.field<[-4,68]xf64>) -> !stencil.temp<[-1,68]xf64> + %3 = "stencil.apply"(%2) ({ + ^0(%4 : !stencil.temp<[-1,68]xf64>): + %5 = "stencil.access"(%4) {"offset" = #stencil.index<-1>} : (!stencil.temp<[-1,68]xf64>) -> f64 + "stencil.return"(%5) : (f64) -> () + }) : (!stencil.temp<[-1,68]xf64>) -> !stencil.temp<[0,68]xf64> + "stencil.store"(%3, %outc) {"lb" = #stencil.index<0>, "ub" = #stencil.index<68>} : (!stencil.temp<[0,68]xf64>, !stencil.field<[0,1024]xf64>) -> () + "func.return"() : () -> () + } + +// CHECK: func.func @copy_1d(%20 : memref, %out : memref) { +// CHECK-NEXT: %21 = "memref.cast"(%20) : (memref) -> memref<72xf64> +// CHECK-NEXT: %outc = "memref.cast"(%out) : (memref) -> memref<1024xf64> +// CHECK-NEXT: %outc_storeview = "memref.subview"(%outc) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<1024xf64>) -> memref<68xf64, strided<[1]>> +// CHECK-NEXT: %22 = "memref.subview"(%21) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72xf64>) -> memref<69xf64, strided<[1], offset: 3>> +// CHECK-NEXT: %23 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %24 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %25 = "arith.constant"() {"value" = 68 : index} : () -> index +// CHECK-NEXT: "scf.parallel"(%23, %25, %24) ({ +// CHECK-NEXT: ^6(%26 : index): +// CHECK-NEXT: %27 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %28 = arith.addi %26, %27 : index +// CHECK-NEXT: %29 = "memref.load"(%22, %28) : (memref<69xf64, strided<[1], offset: 3>>, index) -> f64 +// CHECK-NEXT: "memref.store"(%29, %outc_storeview, %26) : (f64, memref<68xf64, strided<[1]>>, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () +// CHECK-NEXT: "func.return"() : () -> () +// CHECK-NEXT: } + + func.func private @copy_2d(%0 : !stencil.field) { + %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]xf64> + %2 = "stencil.load"(%1) : (!stencil.field<[-4,68]x[-4,68]xf64>) -> !stencil.temp<[-1,64]x[0,68]xf64> + %3 = "stencil.apply"(%2) ({ + ^0(%4 : !stencil.temp<[-1,64]x[0,68]xf64>): + %5 = "stencil.access"(%4) {"offset" = #stencil.index<-1, 0>} : (!stencil.temp<[-1,64]x[0,68]xf64>) -> f64 + "stencil.return"(%5) : (f64) -> () + }) : (!stencil.temp<[-1,64]x[0,68]xf64>) -> !stencil.temp<[0,64]x[0,68]xf64> + "func.return"() : () -> () + } +// CHECK: func.func private @copy_2d(%30 : memref) { +// CHECK-NEXT: %31 = "memref.cast"(%30) : (memref) -> memref<72x72xf64> +// CHECK-NEXT: %32 = "memref.subview"(%31) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72xf64>) -> memref<65x68xf64, strided<[72, 1], offset: 220>> +// CHECK-NEXT: %33 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %34 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %35 = "arith.constant"() {"value" = 64 : index} : () -> index +// CHECK-NEXT: %36 = "arith.constant"() {"value" = 68 : index} : () -> index +// CHECK-NEXT: "scf.parallel"(%33, %35, %34) ({ +// CHECK-NEXT: ^7(%37 : index): +// CHECK-NEXT: "scf.for"(%33, %36, %34) ({ +// CHECK-NEXT: ^8(%38 : index): +// CHECK-NEXT: %39 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %40 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %41 = arith.addi %37, %39 : index +// CHECK-NEXT: %42 = arith.addi %38, %40 : index +// CHECK-NEXT: %43 = "memref.load"(%32, %41, %42) : (memref<65x68xf64, strided<[72, 1], offset: 220>>, index, index) -> f64 +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) : (index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () +// CHECK-NEXT: "func.return"() : () -> () +// CHECK-NEXT: } + + func.func private @copy_3d(%0 : !stencil.field) { + %1 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,70]x[-4,72]xf64> + %2 = "stencil.load"(%1) : (!stencil.field<[-4,68]x[-4,70]x[-4,72]xf64>) -> !stencil.temp<[-1,64]x[0,64]x[0,69]xf64> + %3 = "stencil.apply"(%2) ({ + ^0(%4 : !stencil.temp<[-1,64]x[0,64]x[0,69]xf64>): + %5 = "stencil.access"(%4) {"offset" = #stencil.index<-1, 0, 1>} : (!stencil.temp<[-1,64]x[0,64]x[0,69]xf64>) -> f64 + "stencil.return"(%5) : (f64) -> () + }) : (!stencil.temp<[-1,64]x[0,64]x[0,69]xf64>) -> !stencil.temp<[0,64]x[0,64]x[0,68]xf64> + "func.return"() : () -> () + } +// CHECK: func.func private @copy_3d(%44 : memref) { +// CHECK-NEXT: %45 = "memref.cast"(%44) : (memref) -> memref<72x74x76xf64> +// CHECK-NEXT: %46 = "memref.subview"(%45) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x74x76xf64>) -> memref<65x64x69xf64, strided<[5624, 76, 1], offset: 17180>> +// CHECK-NEXT: %47 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %48 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %49 = "arith.constant"() {"value" = 64 : index} : () -> index +// CHECK-NEXT: %50 = "arith.constant"() {"value" = 64 : index} : () -> index +// CHECK-NEXT: %51 = "arith.constant"() {"value" = 68 : index} : () -> index +// CHECK-NEXT: "scf.parallel"(%47, %49, %48) ({ +// CHECK-NEXT: ^9(%52 : index): +// CHECK-NEXT: "scf.for"(%47, %50, %48) ({ +// CHECK-NEXT: ^10(%53 : index): +// CHECK-NEXT: "scf.for"(%47, %51, %48) ({ +// CHECK-NEXT: ^11(%54 : index): +// CHECK-NEXT: %55 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %56 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %57 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %58 = arith.addi %52, %55 : index +// CHECK-NEXT: %59 = arith.addi %53, %56 : index +// CHECK-NEXT: %60 = arith.addi %54, %57 : index +// CHECK-NEXT: %61 = "memref.load"(%46, %58, %59, %60) : (memref<65x64x69xf64, strided<[5624, 76, 1], offset: 17180>>, index, index, index) -> f64 +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) : (index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) : (index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () +// CHECK-NEXT: "func.return"() : () -> () +// CHECK-NEXT: } + + func.func @test_funcop_lowering(%0 : !stencil.field) { + "func.return"() : () -> () + } +// CHECK: func.func @test_funcop_lowering(%62 : memref) { +// CHECK-NEXT: "func.return"() : () -> () +// CHECK-NEXT: } + + func.func @test_funcop_lowering(%1 : !stencil.field<[-1,7]x[-1,7]xf64>) { + "func.return"() : () -> () + } +// CHECK: func.func @test_funcop_lowering(%63 : memref<8x8xf64>) { +// CHECK-NEXT: "func.return"() : () -> () +// CHECK-NEXT: } + + func.func @offsets(%0 : !stencil.field, %1 : !stencil.field, %2 : !stencil.field) { + %3 = "stencil.cast"(%0) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> + %4 = "stencil.cast"(%1) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> + %5 = "stencil.cast"(%2) : (!stencil.field) -> !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64> + %6 = "stencil.load"(%3) : (!stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>) -> !stencil.temp<[-1,65]x[-1,65]x[0,64]xf64> + %7, %8 = "stencil.apply"(%6) ({ + ^0(%9 : !stencil.temp<[-1,65]x[-1,65]x[0,64]xf64>): + %10 = "stencil.access"(%9) {"offset" = #stencil.index<-1, 0, 0>} : (!stencil.temp<[-1,65]x[-1,65]x[0,64]xf64>) -> f64 + %11 = "stencil.access"(%9) {"offset" = #stencil.index<1, 0, 0>} : (!stencil.temp<[-1,65]x[-1,65]x[0,64]xf64>) -> f64 + %12 = "stencil.access"(%9) {"offset" = #stencil.index<0, 1, 0>} : (!stencil.temp<[-1,65]x[-1,65]x[0,64]xf64>) -> f64 + %13 = "stencil.access"(%9) {"offset" = #stencil.index<0, -1, 0>} : (!stencil.temp<[-1,65]x[-1,65]x[0,64]xf64>) -> f64 + %14 = "stencil.access"(%9) {"offset" = #stencil.index<0, 0, 0>} : (!stencil.temp<[-1,65]x[-1,65]x[0,64]xf64>) -> f64 + %15 = arith.addf %10, %11 : f64 + %16 = arith.addf %12, %13 : f64 + %17 = arith.addf %15, %16 : f64 + %cst = "arith.constant"() {"value" = -4.0 : f64} : () -> f64 + %18 = arith.mulf %14, %cst : f64 + %19 = arith.addf %18, %17 : f64 + "stencil.return"(%19, %18) : (f64, f64) -> () + }) : (!stencil.temp<[-1,65]x[-1,65]x[0,64]xf64>) -> (!stencil.temp<[0,64]x[0,64]x[0,64]xf64>, !stencil.temp) + "stencil.store"(%7, %4) {"lb" = #stencil.index<0, 0, 0>, "ub" = #stencil.index<64, 64, 64>} : (!stencil.temp<[0,64]x[0,64]x[0,64]xf64>, !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>) -> () + "func.return"() : () -> () + } + +// CHECK: func.func @offsets(%64 : memref, %65 : memref, %66 : memref) { +// CHECK-NEXT: %67 = "memref.cast"(%64) : (memref) -> memref<72x72x72xf64> +// CHECK-NEXT: %68 = "memref.cast"(%65) : (memref) -> memref<72x72x72xf64> +// CHECK-NEXT: %69 = "memref.subview"(%68) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72x72xf64>) -> memref<64x64x64xf64, strided<[5184, 72, 1], offset: 21028>> +// CHECK-NEXT: %70 = "memref.cast"(%66) : (memref) -> memref<72x72x72xf64> +// CHECK-NEXT: %71 = "memref.subview"(%67) {"static_offsets" = array, "static_sizes" = array, "static_strides" = array, "operand_segment_sizes" = array} : (memref<72x72x72xf64>) -> memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>> +// CHECK-NEXT: %72 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %73 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %74 = "arith.constant"() {"value" = 64 : index} : () -> index +// CHECK-NEXT: %75 = "arith.constant"() {"value" = 64 : index} : () -> index +// CHECK-NEXT: %76 = "arith.constant"() {"value" = 64 : index} : () -> index +// CHECK-NEXT: "scf.parallel"(%72, %74, %73) ({ +// CHECK-NEXT: ^12(%77 : index): +// CHECK-NEXT: "scf.for"(%72, %75, %73) ({ +// CHECK-NEXT: ^13(%78 : index): +// CHECK-NEXT: "scf.for"(%72, %76, %73) ({ +// CHECK-NEXT: ^14(%79 : index): +// CHECK-NEXT: %80 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %81 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %82 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %83 = arith.addi %77, %80 : index +// CHECK-NEXT: %84 = arith.addi %78, %81 : index +// CHECK-NEXT: %85 = arith.addi %79, %82 : index +// CHECK-NEXT: %86 = "memref.load"(%71, %83, %84, %85) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 +// CHECK-NEXT: %87 = "arith.constant"() {"value" = 2 : index} : () -> index +// CHECK-NEXT: %88 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %89 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %90 = arith.addi %77, %87 : index +// CHECK-NEXT: %91 = arith.addi %78, %88 : index +// CHECK-NEXT: %92 = arith.addi %79, %89 : index +// CHECK-NEXT: %93 = "memref.load"(%71, %90, %91, %92) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 +// CHECK-NEXT: %94 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %95 = "arith.constant"() {"value" = 2 : index} : () -> index +// CHECK-NEXT: %96 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %97 = arith.addi %77, %94 : index +// CHECK-NEXT: %98 = arith.addi %78, %95 : index +// CHECK-NEXT: %99 = arith.addi %79, %96 : index +// CHECK-NEXT: %100 = "memref.load"(%71, %97, %98, %99) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 +// CHECK-NEXT: %101 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %102 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %103 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %104 = arith.addi %77, %101 : index +// CHECK-NEXT: %105 = arith.addi %78, %102 : index +// CHECK-NEXT: %106 = arith.addi %79, %103 : index +// CHECK-NEXT: %107 = "memref.load"(%71, %104, %105, %106) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 +// CHECK-NEXT: %108 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %109 = "arith.constant"() {"value" = 1 : index} : () -> index +// CHECK-NEXT: %110 = "arith.constant"() {"value" = 0 : index} : () -> index +// CHECK-NEXT: %111 = arith.addi %77, %108 : index +// CHECK-NEXT: %112 = arith.addi %78, %109 : index +// CHECK-NEXT: %113 = arith.addi %79, %110 : index +// CHECK-NEXT: %114 = "memref.load"(%71, %111, %112, %113) : (memref<66x66x64xf64, strided<[5184, 72, 1], offset: 15772>>, index, index, index) -> f64 +// CHECK-NEXT: %115 = arith.addf %86, %93 : f64 +// CHECK-NEXT: %116 = arith.addf %100, %107 : f64 +// CHECK-NEXT: %117 = arith.addf %115, %116 : f64 +// CHECK-NEXT: %cst = "arith.constant"() {"value" = -4.0 : f64} : () -> f64 +// CHECK-NEXT: %118 = arith.mulf %114, %cst : f64 +// CHECK-NEXT: %119 = arith.addf %118, %117 : f64 +// CHECK-NEXT: "memref.store"(%119, %69, %77, %78, %79) : (f64, memref<64x64x64xf64, strided<[5184, 72, 1], offset: 21028>>, index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) : (index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) : (index, index, index) -> () +// CHECK-NEXT: "scf.yield"() : () -> () +// CHECK-NEXT: }) {"operand_segment_sizes" = array} : (index, index, index) -> () +// CHECK-NEXT: "func.return"() : () -> () +// CHECK-NEXT: } + +} +// CHECK-NEXT: }