[Mlir-commits] [mlir] [mlir][linalg] Reimplement SimplifyPackToExpandShape and SimplifyUnPackToCollapseShape for more cases. (PR #204971)

Artem Gindinson llvmlistbot at llvm.org
Mon Jun 29 07:55:22 PDT 2026


================
@@ -5969,7 +5956,13 @@ LogicalResult PackOp::canonicalize(PackOp packOp, PatternRewriter &rewriter) {
   }
 
   // Fold optional PaddingValue operand away if padding is not needed.
-  if (packOp.getPaddingValue() && paddingIsNotNeeded(packOp)) {
+  // Reject the dynamic tile size here.
+  if (packOp.getPaddingValue() &&
+      !ShapedType::isDynamicShape(packOp.getStaticInnerTiles()) &&
----------------
AGindinson wrote:

@JerryShih For context, what example would break if you removed the `isDynamicShape` condition? (Assuming I'm understanding your comment correctly)

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


More information about the Mlir-commits mailing list