diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td @@ -1112,6 +1112,27 @@ return b.createOperation(state); }] >, + InterfaceMethod< + /*desc=*/[{ + Clone the current operation with the given location, operands + and BlockAndValueMapping. This is used to abstract away the + optional underlying region creation. This does not change the + balance between input, output_buffer and init_tensors + operands. + }], + /*retTy=*/"Operation *", + /*methodName=*/"cloneWithMapper", + (ins "OpBuilder &":$b, "Location":$loc, "TypeRange":$resultTypes, + "ValueRange":$operands, "BlockAndValueMapping &":$bvm), + [{ + OperationState state( + loc, ConcreteOp::getOperationName(), operands, resultTypes, + $_op->getAttrs()); + for (Region &r : $_op->getRegions()) + r.cloneInto(state.addRegion(), bvm); + return b.createOperation(state); + }] + >, StaticInterfaceMethod< /*desc=*/[{ Returns the region builder for constructing the body for linalg.generic.