[Mlir-commits] [mlir] [mlir][tensor] Enhance SimplifyPackToExpandShape for unit dim cases. (PR #79247)

lorenzo chelini llvmlistbot at llvm.org
Wed Jan 24 05:21:28 PST 2024


================
@@ -34,26 +41,57 @@ struct SimplifyPackToExpandShape : public OpRewritePattern<PackOp> {
                                                   reassociation);
   }
 
-  LogicalResult matchAndRewrite(PackOp packOp,
-                                PatternRewriter &rewriter) const override {
-    if (packOp.getPaddingValue())
-      return rewriter.notifyMatchFailure(packOp, "expects no padding value");
-
+  /// Returns success() if it is only packing on the innermost dimension.
+  LogicalResult isPackOneInnerMostDim(RewriterBase &rewriter,
----------------
chelini wrote:

nit: `isPackOnInnerMostDim` instead of `isPackOneInnerMostDim`.

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


More information about the Mlir-commits mailing list