[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


================
@@ -573,7 +573,7 @@ PackingMetadata computePackingMetadata(int64_t packedRank,
 /// Removes the op and replaces the constant with a new constant of the result
 /// shape. When an optional cst attribute is passed, it is reshaped only if the
 /// splat value matches the value in the attribute.
-OpFoldResult reshapeConstantSource(DenseElementsAttr source, TensorType result,
+OpFoldResult reshapeConstantSource(DenseElementsAttr source, ShapedType result,
----------------
hanhanW wrote:

I know that you update this because of pack canonicalization patterns:

https://github.com/llvm/llvm-project/blob/4c4e4e4299b16d8dd85811e9dd8697b17c95577f/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp#L5008-L5017

However, constants are mostly tensor types or vector types, IMO. We should not update the code like this because we add memref semantics to pack/unpack ops. Instead, I think we should only kick in the folder when the pack/unpack ops have pure tensor semantic. 

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


More information about the Mlir-commits mailing list