[Mlir-commits] [mlir] [mlir][tensor] Improve `FoldTensorCastProducerOp` (dynamic shapes) (PR #114559)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Nov 1 14:34:13 PDT 2024


================
@@ -4756,8 +4756,50 @@ struct FoldTensorCastProducerOp
         newResultTypes[dpsInitIdx++] = newOperands.back().getType();
     }
 
-    // Clone op.
-    Operation *newOp = clone(rewriter, op, newResultTypes, newOperands);
+    // For ops that have sizes-like attribute, update these accordingly.
+    // For now, only `tensor.pack` is supported.
+    // TODO: Generalize to make it work with other ops as well (e.g.
+    // `tensor.unpack`)
+    SmallVector<OpFoldResult> newMixedTileSizes;
----------------
MaheshRavishankar wrote:

This seems like it is mixing something related to `PackOp` into a method that is for general destination passing style operations. Can we instead just make this a separate pattern?

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


More information about the Mlir-commits mailing list