[Mlir-commits] [mlir] [mlir][vector] Add pattern to rewrite contiguous ExtractStridedSlice into Extract (PR #111541)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Oct 8 13:49:57 PDT 2024
================
@@ -235,6 +235,11 @@ void populateVectorExtractStridedSliceToExtractInsertChainPatterns(
std::function<bool(ExtractStridedSliceOp)> controlFn = nullptr,
PatternBenefit benefit = 1);
+/// Pattern to rewrite simple cases of N-D extract_strided_slice, where the
+/// slice is contiguous, into extract and shape_cast.
+void populateVectorContiguousExtractStridedSliceToExtractPatterns(
+ RewritePatternSet &patterns, PatternBenefit benefit = 1);
----------------
MaheshRavishankar wrote:
Yeah individual patterns and populate is a problem. The proliferation of such methods is difficult to keep track of.
1. I dont have enough to go by whether this is a canonicalization or not. In absence of evidence, and (at least some) justification, id bias towards not a canonicalization. Basically question is if this pattern will unlock other canonicalizations, then its a strong signal that this is a canonicalization.
2. @joker-eph whats your solution for such cases. This kind of thing is a very point-fix for something. There is really not a over-arching problem being solved really. So one option is, we dont add it to MLIR itself, but keep it downstream. That will only make such things be duplicated across all MLIR projects. Where/how do we house such one-off things in core.
https://github.com/llvm/llvm-project/pull/111541
More information about the Mlir-commits
mailing list