[Mlir-commits] [mlir] [MLIR][Linalg] pack, unpack to take memref inputs (PR #129036)

Han-Chung Wang llvmlistbot at llvm.org
Thu Apr 3 11:26:22 PDT 2025


================
@@ -1664,12 +1668,17 @@ static LogicalResult
 vectorizeAsTensorUnpackOp(RewriterBase &rewriter, linalg::UnPackOp unpackOp,
                           ArrayRef<int64_t> inputVectorSizes,
                           SmallVectorImpl<Value> &newResults) {
+  // TODO: Support Memref PackOp. Temporarily return failure.
+  if (!unpackOp.hasPureTensorSemantics())
+    return failure();
 
   // TODO: Introduce a parent class that will handle the insertion point update.
   OpBuilder::InsertionGuard g(rewriter);
   rewriter.setInsertionPoint(unpackOp);
 
-  RankedTensorType unpackTensorType = unpackOp.getSourceType();
+  auto unpackTensorType = dyn_cast<RankedTensorType>(unpackOp.getSourceType());
+  if (!unpackTensorType)
+    return failure();
----------------
hanhanW wrote:

ditto: can be simplified with `cast` and remove the check.

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


More information about the Mlir-commits mailing list