[PATCH] D135837: [mlir][MemRef] Simplify extract_strided_metadata(reinterpret_cast)

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 13:31:25 PDT 2022


qcolombet marked an inline comment as done.
qcolombet added inline comments.


================
Comment at: mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp:690
+    // Check if the source is suitable for extract_strided_metadata.
+    if (!reinterpretCastOp.getSource().getType().isa<MemRefType>())
+      return rewriter.notifyMatchFailure(
----------------
qcolombet wrote:
> nicolasvasilache wrote:
> > qcolombet wrote:
> > > Is there a generic way of doing that?
> > > Something like `ExtractStridedMetadata::verifySourceType`?
> > Implement your own ?
> I'll look into that as a follow up patch if that works for you, since if this doesn't exist yet, it will likely require some tablegen work.
Done that part by reusing the inferReturnTypes API that we enabled for these operations at https://reviews.llvm.org/D135734.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135837



More information about the llvm-commits mailing list