-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[mlir][NFC] Correct pattern names to match the behaviors. #158177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It is a follow-up for llvm#131982 (comment) and llvm#126898 (comment). The names do not match the behaviors and the revision updates the names. Signed-off-by: hanhanW <[email protected]>
|
cc @ofri-frishman (I can't add you to reviewers.) |
|
@llvm/pr-subscribers-mlir-tensor Author: Han-Chung Wang (hanhanW) ChangesIt is a follow-up for #131982 (comment) and #126898 (comment). The names do not match the behaviors, and the revision updates the names. Full diff: https://github.com/llvm/llvm-project/pull/158177.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp b/mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp
index dfce835a1954b..7ec61c7df81cf 100644
--- a/mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp
+++ b/mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp
@@ -319,7 +319,7 @@ struct BubbleUpExpandThroughParallelCollapse
/// Note - this pattern could be extended to be a swap pattern between
/// `tensor.expand_shape` and `tensor.extract_slice`, but is currently
/// implemented only as a bubble up pattern for `tensor.extract_slice`.
-struct BubbleUpExpandShapeThroughExtractSlice
+struct BubbleUpExtractSliceThroughExpandShape
: public OpRewritePattern<tensor::ExtractSliceOp> {
using OpRewritePattern<tensor::ExtractSliceOp>::OpRewritePattern;
@@ -427,7 +427,7 @@ struct BubbleUpExpandShapeThroughExtractSlice
/// to tensor<15xf32>
/// ```
/// But this is not the intended purpose of the transformation.
-struct BubbleUpCollapseShapeThroughExtractSlice
+struct BubbleUpExtractSliceThroughCollapseShape
: public OpRewritePattern<tensor::ExtractSliceOp> {
using OpRewritePattern<tensor::ExtractSliceOp>::OpRewritePattern;
@@ -735,6 +735,6 @@ void mlir::tensor::populateBubbleUpExpandShapePatterns(
void mlir::tensor::populateBubbleUpExtractSliceOpPatterns(
RewritePatternSet &patterns) {
- patterns.add<BubbleUpExpandShapeThroughExtractSlice,
- BubbleUpCollapseShapeThroughExtractSlice>(patterns.getContext());
+ patterns.add<BubbleUpExtractSliceThroughExpandShape,
+ BubbleUpExtractSliceThroughCollapseShape>(patterns.getContext());
}
|
|
@llvm/pr-subscribers-mlir Author: Han-Chung Wang (hanhanW) ChangesIt is a follow-up for #131982 (comment) and #126898 (comment). The names do not match the behaviors, and the revision updates the names. Full diff: https://github.com/llvm/llvm-project/pull/158177.diff 1 Files Affected:
diff --git a/mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp b/mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp
index dfce835a1954b..7ec61c7df81cf 100644
--- a/mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp
+++ b/mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp
@@ -319,7 +319,7 @@ struct BubbleUpExpandThroughParallelCollapse
/// Note - this pattern could be extended to be a swap pattern between
/// `tensor.expand_shape` and `tensor.extract_slice`, but is currently
/// implemented only as a bubble up pattern for `tensor.extract_slice`.
-struct BubbleUpExpandShapeThroughExtractSlice
+struct BubbleUpExtractSliceThroughExpandShape
: public OpRewritePattern<tensor::ExtractSliceOp> {
using OpRewritePattern<tensor::ExtractSliceOp>::OpRewritePattern;
@@ -427,7 +427,7 @@ struct BubbleUpExpandShapeThroughExtractSlice
/// to tensor<15xf32>
/// ```
/// But this is not the intended purpose of the transformation.
-struct BubbleUpCollapseShapeThroughExtractSlice
+struct BubbleUpExtractSliceThroughCollapseShape
: public OpRewritePattern<tensor::ExtractSliceOp> {
using OpRewritePattern<tensor::ExtractSliceOp>::OpRewritePattern;
@@ -735,6 +735,6 @@ void mlir::tensor::populateBubbleUpExpandShapePatterns(
void mlir::tensor::populateBubbleUpExtractSliceOpPatterns(
RewritePatternSet &patterns) {
- patterns.add<BubbleUpExpandShapeThroughExtractSlice,
- BubbleUpCollapseShapeThroughExtractSlice>(patterns.getContext());
+ patterns.add<BubbleUpExtractSliceThroughExpandShape,
+ BubbleUpExtractSliceThroughCollapseShape>(patterns.getContext());
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
It is a follow-up for #131982 (comment) and #126898 (comment).
The names do not match the behaviors, and the revision updates the names.