[PATCH] D72935: [mlir] Add a canonicalization pattern for MemRefCastOp into dynamic MemRefs

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 09:27:09 PST 2020


nicolasvasilache created this revision.
nicolasvasilache added reviewers: ftynse, rriddle, andydavis1.
Herald added subscribers: llvm-commits, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, burmako, jpienaar, mehdi_amini.
Herald added a project: LLVM.

This diff adds a canonicalization pattern to canonicalize either:

  mlir
    ... = memref_cast ... : memref<8x16xf32> to memref<?x?xf32>
    ... = memref_cast ... : memref<8x16xf32, affine_map<(i, j)->(16 * i + j)>>
          to memref<?x?xf32>

into

  mlir
    ... = memref_cast ... : ... to memref<8x16xf32>

This diff additionally needs to modify a seemingly unrelated things that does
not play nicely atm. Some tests that return memref need to be changed because
canonicalization does not propagate to function signature.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72935

Files:
  mlir/include/mlir/Dialect/StandardOps/Ops.td
  mlir/lib/Dialect/StandardOps/Ops.cpp
  mlir/test/Transforms/canonicalize.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72935.238808.patch
Type: text/x-patch
Size: 7892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200117/ad7d1e0e/attachment.bin>


More information about the llvm-commits mailing list