Summery: It's needed for correct work of BufferPlacement.
Differential Revision: https://reviews.llvm.org/D83385
// MemRefCastOp
//===----------------------------------------------------------------------===//
-def MemRefCastOp : CastOp<"memref_cast"> {
+def MemRefCastOp : CastOp<"memref_cast", [
+ DeclareOpInterfaceMethods<ViewLikeOpInterface>
+ ]> {
let summary = "memref cast operation";
let description = [{
Syntax:
// MemRefCastOp
//===----------------------------------------------------------------------===//
+Value MemRefCastOp::getViewSource() { return source(); }
+
bool MemRefCastOp::areCastCompatible(Type a, Type b) {
auto aT = a.dyn_cast<MemRefType>();
auto bT = b.dyn_cast<MemRefType>();