[mlir] Add a MemRefCastOp canonicalization pattern.
authorNicolas Vasilache <ntv@google.com>
Wed, 6 May 2020 13:05:15 +0000 (09:05 -0400)
committerNicolas Vasilache <ntv@google.com>
Wed, 6 May 2020 13:10:05 +0000 (09:10 -0400)
commit94438c86adef0a0f50bc3737253e8c98b4e3dd3e
tree67e206ff06d67ed042a4a10ebd1fa298f01baa33
parent8650b36935ae8e9d584550539161e5851a17a912
[mlir] Add a MemRefCastOp canonicalization pattern.

Summary:
This revision adds a conservative canonicalization pattern for MemRefCastOp that are typically inserted during ViewOp and SubViewOp canonicalization.
Ideally such canonicalizations would propagate the type to consumers but this is not a local behavior. As a consequence MemRefCastOp are introduced to keep type compatibility but need to be cleaned up later, in the case where more dynamic behavior than necessary is introduced.

Differential Revision: https://reviews.llvm.org/D79438
mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
mlir/test/Transforms/canonicalize.mlir