Skip to content

Commit

Permalink
Merge branch 'emilien/better-bufferization' into emilien/stencil-buff…
Browse files Browse the repository at this point in the history
…erized-lowering
  • Loading branch information
PapyChacal authored Aug 17, 2024
2 parents f17ca96 + a914a27 commit daea943
Show file tree
Hide file tree
Showing 21 changed files with 173 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
hooks:
- id: check-yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.0
hooks:
- id: ruff
types_or: [ python, pyi, jupyter ]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dev = [
"lit<19.0.0",
"marimo==0.7.20",
"pre-commit==3.8.0",
"ruff==0.5.7",
"ruff==0.6.0",
"asv<0.7",
"nbconvert>=7.7.2,<8.0.0",
"textual-dev==1.5.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/dialects/test_stencil.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def module():
%9 = arith.addf %8, %7 : f32
stencil.return %9 : f32
}
stencil.store %3 to %1 (<[0], [6]>) : !stencil.temp<?xf32> to !stencil.field<[-1,7]xf32>
stencil.store %3 to %1(<[0], [6]>) : !stencil.temp<?xf32> to !stencil.field<[-1,7]xf32>
func.return
}
}
Expand Down
12 changes: 6 additions & 6 deletions tests/filecheck/dialects/csl/csl-stencil-canonicalize.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ builtin.module {
^0(%8 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %9 : tensor<510xf32>):
csl_stencil.yield %9 : tensor<510xf32>
})
stencil.store %2 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %2 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>

%10 = tensor.empty() : tensor<510xf32>
%11 = csl_stencil.apply(%0 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %10 : tensor<510xf32>) -> (!stencil.temp<[0,1]x[0,1]xtensor<510xf32>>) <{"num_chunks" = 2, "topo" = #dmp.topo<1022x510>, "swaps" = [#csl_stencil.exchange<to [1, 0]>, #csl_stencil.exchange<to [-1, 0]>, #csl_stencil.exchange<to [0, 1]>, #csl_stencil.exchange<to [0, -1]>], "operandSegmentSizes" = array<i32: 1, 1, 0, 0>}> ({
Expand All @@ -27,7 +27,7 @@ builtin.module {
^0(%17 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %18 : tensor<510xf32>):
csl_stencil.yield %18 : tensor<510xf32>
})
stencil.store %11 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %11 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>

%19 = tensor.empty() : tensor<510xf32>
%20 = csl_stencil.apply(%0 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %19 : tensor<510xf32>) -> (!stencil.temp<[0,1]x[0,1]xtensor<510xf32>>) <{"num_chunks" = 2, "topo" = #dmp.topo<1022x510>, "swaps" = [#csl_stencil.exchange<to [1, 0]>, #csl_stencil.exchange<to [-1, 0]>, #csl_stencil.exchange<to [0, 1]>, #csl_stencil.exchange<to [0, -1]>], "operandSegmentSizes" = array<i32: 1, 1, 0, 0>}> ({
Expand All @@ -39,7 +39,7 @@ builtin.module {
^0(%26 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %27 : tensor<510xf32>):
csl_stencil.yield %27 : tensor<510xf32>
})
stencil.store %20 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %20 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
func.return
}
}
Expand All @@ -58,7 +58,7 @@ builtin.module {
// CHECK-NEXT: ^1(%8 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %9 : tensor<510xf32>):
// CHECK-NEXT: csl_stencil.yield %9 : tensor<510xf32>
// CHECK-NEXT: })
// CHECK-NEXT: stencil.store %2 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %2 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: %3 = csl_stencil.apply(%0 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %1 : tensor<510xf32>) -> (!stencil.temp<[0,1]x[0,1]xtensor<510xf32>>) <{"num_chunks" = 2 : i64, "topo" = #dmp.topo<1022x510>, "swaps" = [#csl_stencil.exchange<to [1, 0]>, #csl_stencil.exchange<to [-1, 0]>, #csl_stencil.exchange<to [0, 1]>, #csl_stencil.exchange<to [0, -1]>], "operandSegmentSizes" = array<i32: 1, 1, 0, 0>}> ({
// CHECK-NEXT: ^0(%4 : tensor<4x255xf32>, %5 : index, %6 : tensor<510xf32>):
// CHECK-NEXT: %7 = csl_stencil.access %4[1, 0] : tensor<4x255xf32>
Expand All @@ -68,7 +68,7 @@ builtin.module {
// CHECK-NEXT: ^1(%9 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %10 : tensor<510xf32>):
// CHECK-NEXT: csl_stencil.yield %10 : tensor<510xf32>
// CHECK-NEXT: })
// CHECK-NEXT: stencil.store %3 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %3 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: %4 = csl_stencil.apply(%0 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %1 : tensor<510xf32>) -> (!stencil.temp<[0,1]x[0,1]xtensor<510xf32>>) <{"num_chunks" = 2 : i64, "topo" = #dmp.topo<1022x510>, "swaps" = [#csl_stencil.exchange<to [1, 0]>, #csl_stencil.exchange<to [-1, 0]>, #csl_stencil.exchange<to [0, 1]>, #csl_stencil.exchange<to [0, -1]>], "operandSegmentSizes" = array<i32: 1, 1, 0, 0>}> ({
// CHECK-NEXT: ^0(%5 : tensor<4x255xf32>, %6 : index, %7 : tensor<510xf32>):
// CHECK-NEXT: %8 = csl_stencil.access %5[1, 0] : tensor<4x255xf32>
Expand All @@ -78,7 +78,7 @@ builtin.module {
// CHECK-NEXT: ^1(%10 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %11 : tensor<510xf32>):
// CHECK-NEXT: csl_stencil.yield %11 : tensor<510xf32>
// CHECK-NEXT: })
// CHECK-NEXT: stencil.store %4 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %4 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
// CHECK-NEXT: }
8 changes: 4 additions & 4 deletions tests/filecheck/dialects/csl/csl-stencil-ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ builtin.module {
%20 = arith.mulf %17, %19 : tensor<510xf32>
stencil.return %20 : tensor<510xf32>
}
stencil.store %1 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %1 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
func.return
}
}
Expand Down Expand Up @@ -54,7 +54,7 @@ builtin.module {
// CHECK-NEXT: %20 = arith.mulf %17, %19 : tensor<510xf32>
// CHECK-NEXT: stencil.return %20 : tensor<510xf32>
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %1 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %1 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
// CHECK-NEXT: }
Expand Down Expand Up @@ -133,7 +133,7 @@ builtin.module {
csl_stencil.yield %21 : tensor<510xf32>
})

stencil.store %2 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %2 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
func.return
}
}
Expand Down Expand Up @@ -167,7 +167,7 @@ builtin.module {
// CHECK-NEXT: %21 = arith.mulf %17, %20 : tensor<510xf32>
// CHECK-NEXT: csl_stencil.yield %21 : tensor<510xf32>
// CHECK-NEXT: })
// CHECK-NEXT: stencil.store %2 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %2 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
// CHECK-NEXT: }
Expand Down
6 changes: 3 additions & 3 deletions tests/filecheck/dialects/stencil/canonicalize.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func.func @dup_operand(%f : !stencil.field<[0,64]xf64>, %of1 : !stencil.field<[0
// CHECK-NEXT: %0 = stencil.access %one[0] : !stencil.temp<?xf64>
// CHECK-NEXT: stencil.return %0, %0 : f64, f64
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %o1 to %of1 (<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: stencil.store %o2 to %of2 (<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: stencil.store %o1 to %of1(<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: stencil.store %o2 to %of2(<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }

Expand All @@ -44,6 +44,6 @@ func.func @unused_res(%f1 : !stencil.field<[0,64]xf64>, %f2 : !stencil.field<[0,
// CHECK-NEXT: %0 = stencil.access %one[0] : !stencil.temp<?xf64>
// CHECK-NEXT: stencil.return %0 : f64
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %o1 to %of (<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: stencil.store %o1 to %of(<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
8 changes: 4 additions & 4 deletions tests/filecheck/dialects/stencil/oec-kernels/fvtp2d_qi.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ func.func @fvtp2d_qi(%arg0: !stencil.field<?x?x?xf64>, %arg1: !stencil.field<?x?
// CHECK-NEXT: %29 = stencil.store_result %28 : !stencil.result<f64>
// CHECK-NEXT: stencil.return %29 : !stencil.result<f64>
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %17 to %6 (<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<?x?x?xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// CHECK-NEXT: stencil.store %19 to %5 (<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<?x?x?xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// CHECK-NEXT: stencil.store %17 to %6(<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<?x?x?xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// CHECK-NEXT: stencil.store %19 to %5(<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<?x?x?xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }

Expand Down Expand Up @@ -349,8 +349,8 @@ func.func @fvtp2d_qi(%arg0: !stencil.field<?x?x?xf64>, %arg1: !stencil.field<?x?
// SHAPE-NEXT: %35 = stencil.store_result %34 : !stencil.result<f64>
// SHAPE-NEXT: stencil.return %35 : !stencil.result<f64>
// SHAPE-NEXT: }
// SHAPE-NEXT: stencil.store %22 to %6 (<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<[0,64]x[0,65]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// SHAPE-NEXT: stencil.store %25 to %5 (<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<[0,64]x[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// SHAPE-NEXT: stencil.store %22 to %6(<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<[0,64]x[0,65]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// SHAPE-NEXT: stencil.store %25 to %5(<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<[0,64]x[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// SHAPE-NEXT: func.return
// SHAPE-NEXT: }

Expand Down
24 changes: 12 additions & 12 deletions tests/filecheck/dialects/stencil/stencil_ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ builtin.module {
%8 = stencil.store_result %7 : !stencil.result<f64>
stencil.return %8 : !stencil.result<f64>
}
stencil.store %5 to %3 (<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<[0,64]x[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
stencil.store %5 to %3(<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<[0,64]x[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
func.return
}
}
Expand All @@ -25,7 +25,7 @@ builtin.module {
// CHECK-NEXT: %8 = stencil.store_result %7 : !stencil.result<f64>
// CHECK-NEXT: stencil.return %8 : !stencil.result<f64>
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %5 to %3 (<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<[0,64]x[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// CHECK-NEXT: stencil.store %5 to %3(<[0, 0, 0], [64, 64, 64]>) : !stencil.temp<[0,64]x[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]x[-4,68]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }

Expand All @@ -44,7 +44,7 @@ builtin.module {
%v = stencil.access %ti_[0, 0, 0] : !stencil.temp<?x?x?xf32>
stencil.return %v : f32
}
stencil.store %tip1 to %fip1 (<[0, 0, 0], [50, 80, 40]>) : !stencil.temp<?x?x?xf32> to !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>
stencil.store %tip1 to %fip1(<[0, 0, 0], [50, 80, 40]>) : !stencil.temp<?x?x?xf32> to !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>
scf.yield %fip1, %fi : !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>, !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>
}
func.return
Expand All @@ -63,7 +63,7 @@ builtin.module {
// CHECK-NEXT: %v = stencil.access %ti_[0, 0, 0] : !stencil.temp<?x?x?xf32>
// CHECK-NEXT: stencil.return %v : f32
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %tip1 to %fip1 (<[0, 0, 0], [50, 80, 40]>) : !stencil.temp<?x?x?xf32> to !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>
// CHECK-NEXT: stencil.store %tip1 to %fip1(<[0, 0, 0], [50, 80, 40]>) : !stencil.temp<?x?x?xf32> to !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>
// CHECK-NEXT: scf.yield %fip1, %fi : !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>, !stencil.field<[-4,54]x[-4,84]x[-4,44]xf32>
// CHECK-NEXT: }
// CHECK-NEXT: func.return
Expand All @@ -90,7 +90,7 @@ builtin.module {
%17 = arith.mulf %16, %13 : f64
stencil.return %17 : f64
}
stencil.store %5 to %3 (<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
stencil.store %5 to %3(<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
func.return
}
}
Expand All @@ -114,7 +114,7 @@ builtin.module {
// CHECK-NEXT: %17 = arith.mulf %16, %13 : f64
// CHECK-NEXT: stencil.return %17 : f64
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %5 to %3 (<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
// CHECK-NEXT: stencil.store %5 to %3(<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }

Expand All @@ -133,7 +133,7 @@ builtin.module {
stencil.return %9 : f64
}
%10 = stencil.combine 0 at 11 lower = (%6 : !stencil.temp<?xf64>) upper = (%7 : !stencil.temp<?xf64>) : !stencil.temp<?xf64>
stencil.store %10 to %1 (<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[-4,68]xf64>
stencil.store %10 to %1(<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[-4,68]xf64>
func.return
}
}
Expand All @@ -151,7 +151,7 @@ builtin.module {
// CHECK-NEXT: stencil.return %7 : f64
// CHECK-NEXT: }
// CHECK-NEXT: %6 = stencil.combine 0 at 11 lower = (%4 : !stencil.temp<?xf64>) upper = (%5 : !stencil.temp<?xf64>) : !stencil.temp<?xf64>
// CHECK-NEXT: stencil.store %6 to %1 (<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[-4,68]xf64>
// CHECK-NEXT: stencil.store %6 to %1(<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[-4,68]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }

Expand All @@ -167,7 +167,7 @@ builtin.module {
%8 = stencil.access %6[0, _] : !stencil.temp<[-1,65]xf64>
stencil.return %8 : f64
}
stencil.store %5 to %3 (<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
stencil.store %5 to %3(<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
func.return
}
}
Expand All @@ -182,7 +182,7 @@ builtin.module {
// CHECK-NEXT: %8 = stencil.access %6[0, _] : !stencil.temp<[-1,65]xf64>
// CHECK-NEXT: stencil.return %8 : f64
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %5 to %3 (<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
// CHECK-NEXT: stencil.store %5 to %3(<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
// CHECK-NEXT: }
Expand All @@ -200,7 +200,7 @@ builtin.module {
%7 = stencil.dyn_access %6[%i, %j] in <[-1, -1]> : <[1, 1]> : !stencil.temp<[-1,65]x[-1,65]xf64>
stencil.return %7 : f64
}
stencil.store %5 to %3 (<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
stencil.store %5 to %3(<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
func.return
}
}
Expand All @@ -216,7 +216,7 @@ builtin.module {
// CHECK-NEXT: %7 = stencil.dyn_access %6[%i, %j] in <[-1, -1]> : <[1, 1]> : !stencil.temp<[-1,65]x[-1,65]xf64>
// CHECK-NEXT: stencil.return %7 : f64
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %5 to %3 (<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
// CHECK-NEXT: stencil.store %5 to %3(<[0, 0], [64, 64]>) : !stencil.temp<[0,64]x[0,64]xf64> to !stencil.field<[-4,68]x[-4,68]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func.func @dyn_access(%arg0 : !stencil.field<?x?x?xf64>, %arg1 : !stencil.field<
%43 = stencil.store_result %42 : !stencil.result<f64>
stencil.return %8, %13, %18, %23, %28, %33, %38, %43 unroll <[1, 8, 1]> : !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>
}
stencil.store %3 to %1 (<[0, 0, 0], [64, 64, 60]>) : !stencil.temp<[0,64]x[0,64]x[0,60]xf64> to !stencil.field<[-3,67]x[-3,67]x[0,60]xf64>
stencil.store %3 to %1(<[0, 0, 0], [64, 64, 60]>) : !stencil.temp<[0,64]x[0,64]x[0,60]xf64> to !stencil.field<[-3,67]x[-3,67]x[0,60]xf64>
func.return
}

Expand Down Expand Up @@ -100,7 +100,7 @@ func.func @dyn_access(%arg0 : !stencil.field<?x?x?xf64>, %arg1 : !stencil.field<
// CHECK-NEXT: %43 = stencil.store_result %42 : !stencil.result<f64>
// CHECK-NEXT: stencil.return %8, %13, %18, %23, %28, %33, %38, %43 unroll <[1, 8, 1]> : !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>, !stencil.result<f64>
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %3 to %1 (<[0, 0, 0], [64, 64, 60]>) : !stencil.temp<[0,64]x[0,64]x[0,60]xf64> to !stencil.field<[-3,67]x[-3,67]x[0,60]xf64>
// CHECK-NEXT: stencil.store %3 to %1(<[0, 0, 0], [64, 64, 60]>) : !stencil.temp<[0,64]x[0,64]x[0,60]xf64> to !stencil.field<[-3,67]x[-3,67]x[0,60]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
4 changes: 2 additions & 2 deletions tests/filecheck/transforms/csl-stencil-to-csl-wrapper.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ builtin.module {
%25 = arith.mulf %22, %24 : tensor<510xf32>
csl_stencil.yield %25 : tensor<510xf32>
})
stencil.store %2 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %2 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
func.return
}
}
Expand Down Expand Up @@ -87,7 +87,7 @@ builtin.module {
// CHECK-NEXT: %60 = arith.mulf %57, %59 : tensor<510xf32>
// CHECK-NEXT: csl_stencil.yield %60 : tensor<510xf32>
// CHECK-NEXT: })
// CHECK-NEXT: stencil.store %37 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %37 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: csl.return
// CHECK-NEXT: }
// CHECK-NEXT: "csl_wrapper.yield"() <{"fields" = []}> : () -> ()
Expand Down
Loading

0 comments on commit daea943

Please sign in to comment.