[Mlir-commits] [mlir] 8eba28b - [mlir][NFC] Correct pattern names to match the behaviors. (#158177)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Sep 12 10:57:23 PDT 2025


Author: Han-Chung Wang
Date: 2025-09-12T10:57:20-07:00
New Revision: 8eba28bc8ce9447d09edda6fc79e2191a1669252

URL: https://github.com/llvm/llvm-project/commit/8eba28bc8ce9447d09edda6fc79e2191a1669252
DIFF: https://github.com/llvm/llvm-project/commit/8eba28bc8ce9447d09edda6fc79e2191a1669252.diff

LOG: [mlir][NFC] Correct pattern names to match the behaviors. (#158177)

It is a follow-up for
https://github.com/llvm/llvm-project/pull/131982#discussion_r2286014576
and
https://github.com/llvm/llvm-project/pull/126898#discussion_r2286013250.

The names do not match the behaviors, and the revision updates the
names.

Signed-off-by: hanhanW <hanhan0912 at gmail.com>

Added: 
    

Modified: 
    mlir/lib/Dialect/Tensor/Transforms/ReshapePatterns.cpp

Removed: 
    


################################################################################
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());
 }


        


More information about the Mlir-commits mailing list