Fix memory leaks in MLIR integration tests for vector dialect (NFC)
authorMehdi Amini <joker.eph@gmail.com>
Sun, 3 Oct 2021 03:27:54 +0000 (03:27 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Sun, 3 Oct 2021 03:28:24 +0000 (03:28 +0000)
mlir/test/Integration/Dialect/Vector/CPU/test-compress.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-expand.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-gather.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-maskedload.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-maskedstore.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-scatter.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read-3d.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read.mlir
mlir/test/Integration/Dialect/Vector/CPU/test-transfer-write.mlir

index 9c72014..fecf3fc 100644 (file)
@@ -100,5 +100,6 @@ func @entry() {
   call @printmem16(%A) : (memref<?xf32>) -> ()
   // CHECK-NEXT: ( 0, 1, 2, 3, 11, 13, 15, 7, 0, 1, 2, 3, 12, 13, 14, 15 )
 
+  memref.dealloc %A : memref<?xf32>
   return
 }
index b1cc01a..74c7028 100644 (file)
@@ -93,5 +93,6 @@ func @entry() {
   vector.print %e7 : vector<16xf32>
   // CHECK-NEXT: ( 8, 9, 10, 11, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7 )
 
+  memref.dealloc %A : memref<?xf32>
   return
 }
index eddc4ac..ff8a899 100644 (file)
@@ -86,5 +86,6 @@ func @entry() {
   vector.print %g5 : vector<8xf32>
   // CHECK: ( 0, 6, 1, 3, 5, 4, 9, 2 )
 
+  memref.dealloc %A : memref<?xf32>
   return
 }
index c35ae8d..ebb25a2 100644 (file)
@@ -75,6 +75,7 @@ func @entry() {
   vector.print %l5 : vector<16xf32>
   // CHECK: ( 8, 9, 10, 11, 12, 13, 14, 15, -7, -7, -7, -7, -7, -7, -7, -7 )
 
+  memref.dealloc %A : memref<?xf32>
   return
 }
 
index ef89491..6466771 100644 (file)
@@ -99,5 +99,6 @@ func @entry() {
   call @printmem16(%A) : (memref<?xf32>) -> ()
   // CHECK: ( 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7 )
 
+  memref.dealloc %A : memref<?xf32>
   return
 }
index 0b30c7e..2e570dc 100644 (file)
@@ -114,5 +114,6 @@ func @entry() {
   call @printmem8(%A) : (memref<?xf32>) -> ()
   // CHECK: ( 1, 2, 4, 7, 5, 6, 3, 0 )
 
+  memref.dealloc %A : memref<?xf32>
   return
 }
index 2842096..6564552 100644 (file)
@@ -144,5 +144,6 @@ func @entry() {
       : (memref<?x?x?x?xf32>, index, index, index, index) -> ()
   // CHECK: ( ( ( -42, -42, -42 ), ( -42, -42, -42 ), ( -42, -42, -42 ), ( -42, -42, -42 ), ( -42, -42, -42 ) ), ( ( 20, 20, 20 ), ( 20, 20, 20 ), ( 20, 20, 20 ), ( 20, 20, 20 ), ( 20, 20, 20 ) ) )
 
+  memref.dealloc %A : memref<?x?x?x?xf32>
   return
 }
index 0817527..25dd32b 100644 (file)
@@ -82,6 +82,9 @@ func @entry() {
   call @transfer_read_inbounds_4(%A, %c1) : (memref<?xf32>, index) -> ()
   // Read in-bounds with mask.
   call @transfer_read_mask_inbounds_4(%A, %c1) : (memref<?xf32>, index) -> ()
+
+  memref.dealloc %A : memref<?xf32>
+
   return
 }
 
index 6cca0cc..8cad0c9 100644 (file)
@@ -89,6 +89,7 @@ func @entry() {
   %6 = call @transfer_read_1d(%A) : (memref<?xf32>) -> (vector<32xf32>)
   vector.print %6 : vector<32xf32>
 
+  memref.dealloc %A : memref<?xf32>
   return
 }