[Mlir-commits] [mlir] [mlir][bufferization] LowerDeallocation: declare helper function private (PR #67408)

Martin Erhart llvmlistbot at llvm.org
Tue Sep 26 02:25:19 PDT 2023


https://github.com/maerhart created https://github.com/llvm/llvm-project/pull/67408

None

>From 5fc61690a34d57173ee320612d837d8472431f25 Mon Sep 17 00:00:00 2001
From: Martin Erhart <merhart at google.com>
Date: Tue, 26 Sep 2023 09:22:11 +0000
Subject: [PATCH] [mlir][bufferization] LowerDeallocation: declare helper
 function private

---
 .../lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp | 1 +
 .../Dialect/Bufferization/Transforms/lower-deallocations.mlir   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/mlir/lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp b/mlir/lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp
index c7052434f2c3be6..982d9558d313260 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp
@@ -432,6 +432,7 @@ func::FuncOp mlir::bufferization::buildDeallocationLibraryFunction(
   // Generate the func operation itself.
   auto helperFuncOp = func::FuncOp::create(
       loc, "dealloc_helper", builder.getFunctionType(argTypes, {}));
+  helperFuncOp.setVisibility(SymbolTable::Visibility::Private);
   symbolTable.insert(helperFuncOp);
   auto &block = helperFuncOp.getFunctionBody().emplaceBlock();
   block.addArguments(argTypes, SmallVector<Location>(argTypes.size(), loc));
diff --git a/mlir/test/Dialect/Bufferization/Transforms/lower-deallocations.mlir b/mlir/test/Dialect/Bufferization/Transforms/lower-deallocations.mlir
index 19d3bbf7089c10d..2c69fcab08a8d6a 100644
--- a/mlir/test/Dialect/Bufferization/Transforms/lower-deallocations.mlir
+++ b/mlir/test/Dialect/Bufferization/Transforms/lower-deallocations.mlir
@@ -120,7 +120,7 @@ func.func @conversion_dealloc_multiple_memrefs_and_retained(%arg0: memref<2xf32>
 //      CHECK: memref.dealloc [[RETAIN_CONDS]]
 //      CHECK: return [[OWNERSHIP0]], [[OWNERSHIP1]]
 
-//      CHECK: func @dealloc_helper
+//      CHECK: func private @dealloc_helper
 // CHECK-SAME: ([[TO_DEALLOC_MR:%.+]]: memref<?xindex>, [[TO_RETAIN_MR:%.+]]: memref<?xindex>,
 // CHECK-SAME: [[CONDS:%.+]]: memref<?xi1>, [[DEALLOC_CONDS_OUT:%.+]]: memref<?xi1>,
 // CHECK-SAME: [[RETAIN_CONDS_OUT:%.+]]: memref<?xi1>)



More information about the Mlir-commits mailing list