[Mlir-commits] [mlir] 6b76c4e - [mlir][linalg] Bring populateFoldUnitExtentDimsVia(Reshapes/Slices)Patterns in sync
Matthias Springer
llvmlistbot at llvm.org
Tue Dec 20 04:14:02 PST 2022
Author: Matthias Springer
Date: 2022-12-20T13:10:12+01:00
New Revision: 6b76c4eafde8cc72133c752c05fa479c33221e61
URL: https://github.com/llvm/llvm-project/commit/6b76c4eafde8cc72133c752c05fa479c33221e61
DIFF: https://github.com/llvm/llvm-project/commit/6b76c4eafde8cc72133c752c05fa479c33221e61.diff
LOG: [mlir][linalg] Bring populateFoldUnitExtentDimsVia(Reshapes/Slices)Patterns in sync
Make sure that both functions populate patterns with the same functionality. Both should be refactored at some point so that canonicalization patterns are not populated.
Differential Revision: https://reviews.llvm.org/D140372
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 e4b0593194af1..8dc14ea507104 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
@@ -686,6 +686,12 @@ void mlir::linalg::populateFoldUnitExtentDimsViaSlicesPatterns(
patterns.add<ReplaceUnitExtents>(context,
RankReductionStrategy::ExtractInsertSlice);
patterns.add<FoldUnitDimLoops>(context);
+ // TODO: Patterns unrelated to unit dim folding should be factored out.
+ linalg::FillOp::getCanonicalizationPatterns(patterns, context);
+ tensor::EmptyOp::getCanonicalizationPatterns(patterns, context);
+ tensor::populateFoldTensorEmptyPatterns(patterns);
+ memref::populateResolveRankedShapeTypeResultDimsPatterns(patterns);
+ memref::populateResolveShapedTypeResultDimsPatterns(patterns);
}
void mlir::linalg::populateMoveInitOperandsToInputPattern(
More information about the Mlir-commits
mailing list