Skip to content

Commit 1811994

Browse files
committed
Make FunctionArgTypeConverterFn use FunctionOpInterface
1 parent 913ab76 commit 1811994

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

mlir/include/mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef MLIR_DIALECT_BUFFERIZATION_IR_BUFFERIZABLEOPINTERFACE_H_
1010
#define MLIR_DIALECT_BUFFERIZATION_IR_BUFFERIZABLEOPINTERFACE_H_
1111

12+
#include "mlir/Interfaces/FunctionInterfaces.h"
1213
#include "mlir/IR/Operation.h"
1314
#include "mlir/IR/PatternMatch.h"
1415
#include "mlir/Support/LLVM.h"
@@ -262,7 +263,7 @@ struct BufferizationOptions {
262263
/// Parameters: Value, memory space, func op, bufferization options
263264
using FunctionArgTypeConverterFn =
264265
std::function<BaseMemRefType(TensorType, Attribute memorySpace,
265-
func::FuncOp, const BufferizationOptions &)>;
266+
FunctionOpInterface, const BufferizationOptions &)>;
266267
/// Tensor -> MemRef type converter.
267268
/// Parameters: Value, memory space, bufferization options
268269
using UnknownTypeConverterFn = std::function<BaseMemRefType(

mlir/lib/Dialect/Bufferization/IR/BufferizableOpInterface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "mlir/IR/TypeUtilities.h"
1919
#include "mlir/IR/Value.h"
2020
#include "mlir/Interfaces/ControlFlowInterfaces.h"
21+
#include "mlir/Interfaces/FunctionInterfaces.h"
2122
#include "llvm/ADT/ScopeExit.h"
2223
#include "llvm/Support/Debug.h"
2324

@@ -314,7 +315,7 @@ namespace {
314315
/// Default function arg type converter: Use a fully dynamic layout map.
315316
BaseMemRefType
316317
defaultFunctionArgTypeConverter(TensorType type, Attribute memorySpace,
317-
func::FuncOp funcOp,
318+
FunctionOpInterface funcOp,
318319
const BufferizationOptions &options) {
319320
return getMemRefTypeWithFullyDynamicLayout(type, memorySpace);
320321
}
@@ -361,7 +362,7 @@ BufferizationOptions::dynCastBufferizableOp(Value value) const {
361362
void BufferizationOptions::setFunctionBoundaryTypeConversion(
362363
LayoutMapOption layoutMapOption) {
363364
functionArgTypeConverterFn = [=](TensorType tensorType, Attribute memorySpace,
364-
func::FuncOp funcOp,
365+
FunctionOpInterface funcOp,
365366
const BufferizationOptions &options) {
366367
if (layoutMapOption == LayoutMapOption::IdentityLayoutMap)
367368
return bufferization::getMemRefTypeWithStaticIdentityLayout(tensorType,

0 commit comments

Comments
 (0)