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

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 09:44:36 PST 2020


rriddle requested changes to this revision.
rriddle added inline comments.
This revision now requires changes to proceed.


================
Comment at: mlir/lib/Dialect/StandardOps/Ops.cpp:1804
+
+    rewriter.replaceOpWithNewOp<MemRefCastOp>(castOp, castOp.source(),
+                                              desiredResultType);
----------------
You are replacing with something of a different type. That doesn't really fit as a canonicalization. For this to be conservatively correct, it would mean you need to prevent a memref cast from ever being used: in a function call, as a branch argument, etc.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72935/new/

https://reviews.llvm.org/D72935





More information about the llvm-commits mailing list