[PATCH] D135797: [mlir][MemRef] Move the forwarding patterns for `extract_strided_metadata`

Ivan Butygin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 04:07:14 PST 2022


Hardcode84 added inline comments.
Herald added a subscriber: Moerafaat.


================
Comment at: mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp:1328
+
+  bool atLeastOneReplacement = replaceConstantUsesOf(
+      builder, getLoc(), ArrayRef<TypedValue<IndexType>>(getOffset()),
----------------
Here `replaceConstantUsesOf` creates new ops and replaces uses of op being folded. Is this even legal to do this from the folder? How it will interoperate with greedy rewriter which has no way to know new ops were created or uses were changed?

This should probably be an canonicalization pattern and not folder.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135797



More information about the llvm-commits mailing list