[Mlir-commits] [mlir] 90dac71 - [mlir][bufferize][NFC] Fix FileCheck capture

Matthias Springer llvmlistbot at llvm.org
Mon Oct 3 00:12:08 PDT 2022


Author: Matthias Springer
Date: 2022-10-03T16:06:10+09:00
New Revision: 90dac71a9a9f9040d585fcb24d8c3909eb38e3de

URL: https://github.com/llvm/llvm-project/commit/90dac71a9a9f9040d585fcb24d8c3909eb38e3de
DIFF: https://github.com/llvm/llvm-project/commit/90dac71a9a9f9040d585fcb24d8c3909eb38e3de.diff

LOG: [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

Added: 
    

Modified: 
    mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir

Removed: 
    


################################################################################
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 9cf7cb702a14e..d873e0719ad25 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 
diff erent 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<?xf32>) -> f32
 func.func private @private_func(tensor<?xf32>) -> (f32)
 
 // private_func may modify the buffer arg, but that's OK because %t is writable.


        


More information about the Mlir-commits mailing list