forked from OSchip/llvm-project
[mlir] make memref.cast implement ViewLikeOpInterface
This was seemingly dropped in e2310704d8
,
potentially due to a misrebase. The absence of this trait makes aliasing
analysis incorrect, leading to, e.g., buffer deallocation pass inserting
deallocations too early.
This commit is contained in:
parent
4e67ae7b6b
commit
0aceb61665
|
@ -254,7 +254,8 @@ def MemRef_BufferCastOp : MemRef_Op<"buffer_cast",
|
|||
|
||||
def MemRef_CastOp : MemRef_Op<"cast", [
|
||||
NoSideEffect, SameOperandsAndResultShape,
|
||||
DeclareOpInterfaceMethods<CastOpInterface>
|
||||
DeclareOpInterfaceMethods<CastOpInterface>,
|
||||
ViewLikeOpInterface
|
||||
]> {
|
||||
let summary = "memref cast operation";
|
||||
let description = [{
|
||||
|
@ -325,6 +326,8 @@ def MemRef_CastOp : MemRef_Op<"cast", [
|
|||
let extraClassDeclaration = [{
|
||||
/// Fold the given CastOp into consumer op.
|
||||
static bool canFoldIntoConsumerOp(CastOp castOp);
|
||||
|
||||
Value getViewSource() { return source(); }
|
||||
}];
|
||||
|
||||
let hasFolder = 1;
|
||||
|
|
Loading…
Reference in New Issue