[Mlir-commits] [mlir] [mlir][linalg] Take artificial padding into account for pack/unpack folding. (PR #150272)

Han-Chung Wang llvmlistbot at llvm.org
Thu Jul 24 10:35:41 PDT 2025


================
@@ -220,6 +220,31 @@ struct FoldPadWithPackOp : public OpRewritePattern<PackOp> {
       if (!isEqualConstantIntOrValue(paddingValue, constantPaddingValue))
         return failure();
 
+    // Folding is not allowed if it introduces artificial padding. It is not
+    // safe to fold the ops if any dynamic dimension or tile size is present,
+    // because we can not infer the padding size.
----------------
hanhanW wrote:

Yes, thanks for making it clearer! 

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


More information about the Mlir-commits mailing list