[PATCH] D77727: Only insert memref_cast when needed during canonicalization.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 11:24:11 PDT 2020


rriddle added inline comments.


================
Comment at: mlir/lib/Dialect/StandardOps/IR/Ops.cpp:330
+    for (auto it = uses.begin(); it != uses.end(); it++)
+      it->get().setType(newValue.getType());
+    rewriter.replaceOp(oldOp, {newValue});
----------------
ftynse wrote:
> I'm not certain `setType` is okay inside a rewrite pattern. Can you find another way?
Should be fine if you wrap this loop in: `rewriter.startRootUpdate()`/`rewriter.finalizeRootUpdate()`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77727





More information about the llvm-commits mailing list