[all-commits] [llvm/llvm-project] a9ebdb: [MLIR] Vector: turn the ExtractStridedSlice rewrit...
Benoit Jacob via All-commits
all-commits at lists.llvm.org
Wed Oct 9 06:24:45 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a9ebdbb5ac7de7a028f6060b789196a43aea7580
https://github.com/llvm/llvm-project/commit/a9ebdbb5ac7de7a028f6060b789196a43aea7580
Author: Benoit Jacob <jacob.benoit.1 at gmail.com>
Date: 2024-10-09 (Wed, 09 Oct 2024)
Changed paths:
M mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
M mlir/lib/Dialect/Vector/Transforms/VectorInsertExtractStridedSliceRewritePatterns.cpp
M mlir/test/Dialect/Vector/canonicalize.mlir
R mlir/test/Dialect/Vector/vector-contiguous-extract-strided-slice-to-extract.mlir
M mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp
Log Message:
-----------
[MLIR] Vector: turn the ExtractStridedSlice rewrite pattern from #111541 into a canonicalization (#111614)
This is a reasonable canonicalization because `extract` is more
constrained than `extract_strided_slices`, so there is no loss of
semantics here, just lifting an op to a special-case higher/constrained
op. And the additional `shape_cast` is merely adding leading unit dims
to match the original result type.
Context: discussion on #111541. I wasn't sure how this would turn out,
but in the process of writing this PR, I discovered at least 2 bugs in
the pattern introduced in #111541, which shows the value of shared
canonicalization patterns which are exercised on a high number of
testcases.
---------
Signed-off-by: Benoit Jacob <jacob.benoit.1 at gmail.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list