diff --git a/mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp b/mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp --- a/mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp +++ b/mlir/lib/Dialect/Bufferization/IR/BufferizationDialect.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "mlir/Dialect/Bufferization/IR/Bufferization.h" +#include "mlir/Transforms/InliningUtils.h" using namespace mlir; using namespace mlir::bufferization; @@ -14,6 +15,24 @@ #include "mlir/Dialect/Bufferization/IR/BufferizationOpsDialect.cpp.inc" //===----------------------------------------------------------------------===// +// Bufferization Dialect Interfaces +//===----------------------------------------------------------------------===// + +namespace { +struct BufferizationInlinerInterface : public DialectInlinerInterface { + using DialectInlinerInterface::DialectInlinerInterface; + bool isLegalToInline(Region *, Region *, bool, + BlockAndValueMapping &) const final { + return true; + } + bool isLegalToInline(Operation *, Region *, bool, + BlockAndValueMapping &) const final { + return true; + } +}; +} // end anonymous namespace + +//===----------------------------------------------------------------------===// // Bufferization Dialect //===----------------------------------------------------------------------===// @@ -22,4 +41,5 @@ #define GET_OP_LIST #include "mlir/Dialect/Bufferization/IR/BufferizationOps.cpp.inc" >(); + addInterfaces(); }