[PATCH] D135837: [mlir][MemRef] Simplify extract_strided_metadata(reinterpret_cast)
Nicolas Vasilache via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 13 03:09:37 PDT 2022
nicolasvasilache added inline comments.
================
Comment at: mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp:670
+/// base, baseOffset, ... = extract_strided_metadata(src)
+/// offset = baseOffset + srcOffset
+/// sizes = srcSizes
----------------
This feels very fishy .. I would expect just srcOffset here.
Computing the sum is a "subview"-like semantics, reinterpret_cast should just specify the offset UIAM
================
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:
> Is there a generic way of doing that?
> Something like `ExtractStridedMetadata::verifySourceType`?
Implement your own ?
================
Comment at: mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp:725
+
+ results[1] = makeComposedFoldedAffineApply(
+ rewriter, loc, s0 + s1,
----------------
I am really not sure about this ..
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