[mlir] Add ViewLikeOpInterface to std.memref_cast.
Summery: It's needed for correct work of BufferPlacement. Differential Revision: https://reviews.llvm.org/D83385
This commit is contained in:
parent
2ebf4b6e4c
commit
1ea289681a
|
@ -1772,7 +1772,9 @@ def Log2Op : FloatUnaryOp<"log2"> {
|
|||
// MemRefCastOp
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
def MemRefCastOp : CastOp<"memref_cast"> {
|
||||
def MemRefCastOp : CastOp<"memref_cast", [
|
||||
DeclareOpInterfaceMethods<ViewLikeOpInterface>
|
||||
]> {
|
||||
let summary = "memref cast operation";
|
||||
let description = [{
|
||||
Syntax:
|
||||
|
|
|
@ -1822,6 +1822,8 @@ OpFoldResult LoadOp::fold(ArrayRef<Attribute> cstOperands) {
|
|||
// 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>();
|
||||
|
|
Loading…
Reference in a new issue