[Mlir-commits] [mlir] [MLIR][Linalg] pack, unpack to take memref inputs (PR #129036)
Han-Chung Wang
llvmlistbot at llvm.org
Fri Mar 28 11:08:22 PDT 2025
================
@@ -4951,7 +4993,7 @@ LogicalResult PackOp::canonicalize(PackOp packOp, PatternRewriter &rewriter) {
rewriter.modifyOpInPlace(packOp, [&] {
packOp.getSourceMutable().assign(source);
packOp.getDestMutable().assign(dest);
- packOp.getResult().setType(cast<RankedTensorType>(dest.getType()));
+ packOp.getResult().setType(cast<ShapedType>(dest.getType()));
----------------
hanhanW wrote:
I believe that this snippet is wrong after we add the memref semantics to pack ops. Because
1. There are no results in memref. Updating the type is incorrect.
2. The above comment states that it inserts `tensor.cast` op, while we need `memref.cast` op for memref version.
Thus, I suggest to kick in the canonicalization pattern only when the pack op has tensor semantics. Otherwise, the code is wrong to me.
https://github.com/llvm/llvm-project/pull/129036
More information about the Mlir-commits
mailing list