From 90dac71a9a9f9040d585fcb24d8c3909eb38e3de Mon Sep 17 00:00:00 2001 From: Matthias Springer Date: Mon, 3 Oct 2022 16:05:39 +0900 Subject: [PATCH] [mlir][bufferize][NFC] Fix FileCheck capture One of the test cases matched IR from a subsequent test case. For this reason, the test case appeared to pass while it is actually broken. This change does not fix the test case itself. It will be fixed when we overhaul the buffer deallocation implementation. (The memory leak in this test case is an edge case.) Differential Revision: https://reviews.llvm.org/D135046 --- .../Bufferization/Transforms/one-shot-module-bufferize.mlir | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir b/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir index 9cf7cb702a14..d873e0719ad2 100644 --- a/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir +++ b/mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir @@ -37,6 +37,7 @@ func.func @empty_func() -> () { // CHECK: func private @external_func_with_return_val(memref<4xi32, strided{{.*}}>) -> f32 // CHECK-FULLY-DYNAMIC-LAYOUT-MAP-LABEL: func private @external_func_with_return_val(memref<4xi32, // CHECK-FULLY-DYNAMIC-LAYOUT-MAP-SAME: strided<[?], offset: ?>> +// CHECK-NO-LAYOUT-MAP-LABEL: func private @external_func_with_return_val(memref<4xi32>) func.func private @external_func_with_return_val(tensor<4xi32>) -> f32 // ----- @@ -53,7 +54,9 @@ func.func private @external_func_with_return_val(tensor<4xi32>) -> f32 // CHECK-NO-LAYOUT-MAP: %[[subview:.*]] = memref.subview {{.*}} : memref<20x10xf32> to memref<2x?xf32, strided<[10, 1], offset: ?>> // CHECK-NO-LAYOUT-MAP: %[[alloc_no_layout:.*]] = memref.alloc(%{{.*}}) : memref<2x?xf32> // CHECK-NO-LAYOUT-MAP: memref.copy %[[subview]], %[[alloc_no_layout]] -// CHECK-NO-LAYOUT-MAP: memref.dealloc %[[alloc]] +// TODO: %alloc should be deallocated here, but we currently do not dealloc +// buffers that are inserted due to to_tensor/to_memref canonicalization (when +// the buffer types have different layout maps). // CHECK-NO-LAYOUT-MAP: return %[[alloc_no_layout]] // CHECK-FULLY-DYNAMIC-LAYOUT-MAP-LABEL: func @return_extract_slice(%{{.*}}) -> memref<2x?xf32, @@ -69,6 +72,7 @@ func.func @return_extract_slice(%idx: index, %sz: index) -> (tensor<2x?xf32>) // ----- // CHECK-LABEL: func private @private_func +// CHECK-NO-LAYOUT-MAP-LABEL: func private @private_func(memref) -> f32 func.func private @private_func(tensor) -> (f32) // private_func may modify the buffer arg, but that's OK because %t is writable.