[Mlir-commits] [mlir] [mlir][vector] Add pattern to rewrite contiguous ExtractStridedSlice into Extract (PR #111541)
Benoit Jacob
llvmlistbot at llvm.org
Tue Oct 8 13:50:06 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);
----------------
bjacob wrote:
I'll step aside and let the compiler experts chime in! I just needed an ad-hoc pattern to unblock my project. I thought that having it upstream rather than downstream was a healthy default to have, and didn't have to be a lot more work than downstream; and if the correct next step is to debate whether this pattern is a canonicalization, then hopefully having the concrete code to look at helps to root this conversation. No strong opinion though and I'll happily go with what others decide here, for next time.
https://github.com/llvm/llvm-project/pull/111541
More information about the Mlir-commits
mailing list