Skip to content

Commit fec5e97

Browse files
committed
fixup! fixup! fixup! [mlir][linalg] Add e2e test for linalg.mmt4d
Add "private-function-dynamic-ownership" to "-buffer-deallocation-pipeline". This prevents the bufferizer from inserting `bufferization.clone` (which are a bit tricky to remove) while still avoiding leaks.
1 parent 822969d commit fec5e97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mlir/test/Integration/Dialect/Linalg/CPU/pack-unpack-mmt4d.mlir

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// DEFINE: %{compile} = mlir-opt %s \
22
// DEFINE: -transform-interpreter -test-transform-dialect-erase-schedule \
33
// DEFINE: -one-shot-bufferize="bufferize-function-boundaries" \
4-
// DEFINE: -buffer-deallocation-pipeline -cse -canonicalize -convert-vector-to-scf -test-lower-to-llvm
4+
// DEFINE: -buffer-deallocation-pipeline="private-function-dynamic-ownership" \
5+
// DEFINE: -cse -canonicalize -test-lower-to-llvm
56
// DEFINE: %{entry_point} = main
67
// DEFINE: %{run} = mlir-cpu-runner -e %{entry_point} -entry-point-result=void \
78
// DEFINE: -shared-libs=%mlir_runner_utils,%mlir_c_runner_utils
@@ -70,14 +71,14 @@ func.func @main() {
7071
return
7172
}
7273

73-
func.func @matmul(%A: tensor<7x16xi32>, %B: tensor<16x13xi32>, %C: tensor<7x13xi32>) -> tensor<7x13xi32> {
74+
func.func private @matmul(%A: tensor<7x16xi32>, %B: tensor<16x13xi32>, %C: tensor<7x13xi32>) -> tensor<7x13xi32> {
7475
%C_matmul = linalg.matmul ins(%A, %B: tensor<7x16xi32>, tensor<16x13xi32>)
7576
outs(%C: tensor<7x13xi32>) -> tensor<7x13xi32>
7677

7778
return %C_matmul : tensor<7x13xi32>
7879
}
7980

80-
func.func @mmt4d(%A: tensor<7x16xi32>, %B: tensor<16x13xi32>, %C: tensor<7x13xi32>) -> tensor<7x13xi32> {
81+
func.func private @mmt4d(%A: tensor<7x16xi32>, %B: tensor<16x13xi32>, %C: tensor<7x13xi32>) -> tensor<7x13xi32> {
8182
%zero = arith.constant 0 : i32
8283

8384
%A_pack_empty = tensor.empty() : tensor<2x16x8x1xi32>

0 commit comments

Comments
 (0)