[Mlir-commits] [mlir] [mlir][vector] Add pattern to drop unit dim from elementwise(a, b)) (PR #74817)

Andrzej Warzyński llvmlistbot at llvm.org
Wed Dec 13 01:00:05 PST 2023


================
@@ -1514,6 +1625,15 @@ void mlir::vector::populateShapeCastFoldingPatterns(RewritePatternSet &patterns,
   patterns.add<ShapeCastOpFolder>(patterns.getContext(), benefit);
 }
 
+void mlir::vector::populateReorderShapeCastPatterns(RewritePatternSet &patterns,
+                                                    PatternBenefit benefit) {
+  patterns.add<ReorderShapeCastWithUnitDimAndArith<arith::AddIOp>,
+               ReorderShapeCastWithUnitDimAndArith<arith::AddFOp>,
+               ReorderShapeCastWithUnitDimAndArith<arith::MulIOp>,
+               ReorderShapeCastWithUnitDimAndArith<arith::MulFOp>>(
+      patterns.getContext(), benefit);
----------------
banach-space wrote:

Added `ShapeCastOpFolder` 👍🏻 

https://github.com/llvm/llvm-project/pull/74817


More information about the Mlir-commits mailing list