[Mlir-commits] [mlir] 51b9f0b - Fix memory leaks in MLIR integration tests for vector dialect (NFC)

Mehdi Amini llvmlistbot at llvm.org
Sat Oct 2 20:28:31 PDT 2021


Author: Mehdi Amini
Date: 2021-10-03T03:28:24Z
New Revision: 51b9f0b82ab11a79fafb9b499017214f59e32bf3

URL: https://github.com/llvm/llvm-project/commit/51b9f0b82ab11a79fafb9b499017214f59e32bf3
DIFF: https://github.com/llvm/llvm-project/commit/51b9f0b82ab11a79fafb9b499017214f59e32bf3.diff

LOG: Fix memory leaks in MLIR integration tests for vector dialect (NFC)

Added: 
    

Modified: 
    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

Removed: 
    


################################################################################
diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-compress.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-compress.mlir
index 9c720149f6e5b..fecf3fc3202c4 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-compress.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-compress.mlir
@@ -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
 }

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-expand.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-expand.mlir
index b1cc01a20b287..74c7028dd20c1 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-expand.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-expand.mlir
@@ -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
 }

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-gather.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-gather.mlir
index eddc4ac7a1314..ff8a899917fb4 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-gather.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-gather.mlir
@@ -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
 }

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-maskedload.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-maskedload.mlir
index c35ae8ddc3883..ebb25a2670ea0 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-maskedload.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-maskedload.mlir
@@ -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
 }
 

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-maskedstore.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-maskedstore.mlir
index ef89491920468..64667711a5843 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-maskedstore.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-maskedstore.mlir
@@ -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
 }

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-scatter.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-scatter.mlir
index 0b30c7e36ac25..2e570dc6fdeb6 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-scatter.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-scatter.mlir
@@ -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
 }

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read-3d.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read-3d.mlir
index 284209657678d..6564552f4efbb 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read-3d.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read-3d.mlir
@@ -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
 }

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read.mlir
index 081752749e583..25dd32b52aa59 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-read.mlir
@@ -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
 }
 

diff  --git a/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-write.mlir b/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-write.mlir
index 6cca0cc1ad26f..8cad0c9d69371 100644
--- a/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-write.mlir
+++ b/mlir/test/Integration/Dialect/Vector/CPU/test-transfer-write.mlir
@@ -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
 }
 


        


More information about the Mlir-commits mailing list