Skip to content

Commit 5c6eefb

Browse files
authored
[mlir][bufferization] LowerDeallocation: declare helper function private (#67408)
1 parent e972bdb commit 5c6eefb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mlir/lib/Dialect/Bufferization/Transforms/LowerDeallocations.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ func::FuncOp mlir::bufferization::buildDeallocationLibraryFunction(
432432
// Generate the func operation itself.
433433
auto helperFuncOp = func::FuncOp::create(
434434
loc, "dealloc_helper", builder.getFunctionType(argTypes, {}));
435+
helperFuncOp.setVisibility(SymbolTable::Visibility::Private);
435436
symbolTable.insert(helperFuncOp);
436437
auto &block = helperFuncOp.getFunctionBody().emplaceBlock();
437438
block.addArguments(argTypes, SmallVector<Location>(argTypes.size(), loc));

mlir/test/Dialect/Bufferization/Transforms/lower-deallocations.mlir

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func.func @conversion_dealloc_multiple_memrefs_and_retained(%arg0: memref<2xf32>
120120
// CHECK: memref.dealloc [[RETAIN_CONDS]]
121121
// CHECK: return [[OWNERSHIP0]], [[OWNERSHIP1]]
122122

123-
// CHECK: func @dealloc_helper
123+
// CHECK: func private @dealloc_helper
124124
// CHECK-SAME: ([[TO_DEALLOC_MR:%.+]]: memref<?xindex>, [[TO_RETAIN_MR:%.+]]: memref<?xindex>,
125125
// CHECK-SAME: [[CONDS:%.+]]: memref<?xi1>, [[DEALLOC_CONDS_OUT:%.+]]: memref<?xi1>,
126126
// CHECK-SAME: [[RETAIN_CONDS_OUT:%.+]]: memref<?xi1>)

0 commit comments

Comments
 (0)