diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -1772,7 +1772,9 @@ // MemRefCastOp //===----------------------------------------------------------------------===// -def MemRefCastOp : CastOp<"memref_cast"> { +def MemRefCastOp : CastOp<"memref_cast", [ + DeclareOpInterfaceMethods + ]> { let summary = "memref cast operation"; let description = [{ Syntax: diff --git a/mlir/lib/Dialect/StandardOps/IR/Ops.cpp b/mlir/lib/Dialect/StandardOps/IR/Ops.cpp --- a/mlir/lib/Dialect/StandardOps/IR/Ops.cpp +++ b/mlir/lib/Dialect/StandardOps/IR/Ops.cpp @@ -1822,6 +1822,8 @@ // MemRefCastOp //===----------------------------------------------------------------------===// +Value MemRefCastOp::getViewSource() { return source(); } + bool MemRefCastOp::areCastCompatible(Type a, Type b) { auto aT = a.dyn_cast(); auto bT = b.dyn_cast();