[Mlir-commits] [mlir] f3b4e47 - [mlir][linalg][NFC] Drop redundant rankReductionStrategy (#107875)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Sep 9 18:19:27 PDT 2024


Author: Longsheng Mou
Date: 2024-09-10T09:19:22+08:00
New Revision: f3b4e47b34e59625e2c8420ce8bf789373177d6d

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

LOG: [mlir][linalg][NFC] Drop redundant rankReductionStrategy (#107875)

This patch drop redundant rankReductionStrategy in
`populateFoldUnitExtentDimsViaSlicesPatterns` and fixes comment typos.

Added: 
    

Modified: 
    mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp b/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
index 88ef82fb38d67b..90ee0fb3bf0b6b 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
@@ -526,12 +526,11 @@ linalg::dropUnitDims(RewriterBase &rewriter, GenericOp genericOp,
   rewriter.inlineRegionBefore(genericOp.getRegion(), replacementOp.getRegion(),
                               replacementOp.getRegion().begin());
   // 5a. Replace `linalg.index` operations that refer to the dropped unit
-  // dimensions.
+  //     dimensions.
   replaceUnitDimIndexOps(replacementOp, unitDims, rewriter);
 
   // 6. If any result type changes, insert a reshape/slice to convert from the
-  // original
-  //    type to the new type.
+  //    original type to the new type.
   SmallVector<Value> resultReplacements;
   for (auto [index, result] : llvm::enumerate(replacementOp.getResults())) {
     unsigned opOperandIndex = index + replacementOp.getNumDpsInputs();
@@ -789,8 +788,6 @@ static void
 populateFoldUnitExtentDimsViaSlicesPatterns(RewritePatternSet &patterns,
                                             ControlDropUnitDims &options) {
   auto *context = patterns.getContext();
-  options.rankReductionStrategy =
-      ControlDropUnitDims::RankReductionStrategy::ExtractInsertSlice;
   patterns.add<DropUnitDims>(context, options);
   patterns.add<DropPadUnitDims>(context, options);
   // TODO: Patterns unrelated to unit dim folding should be factored out.


        


More information about the Mlir-commits mailing list