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

Han-Chung Wang llvmlistbot at llvm.org
Tue Apr 1 15:22:12 PDT 2025


================
@@ -4426,15 +4428,30 @@ static LogicalResult commonVerifierPackAndUnPackOp(OpTy packOrUnPack) {
         tiles, [](OpFoldResult tile) { return isConstantIntValue(tile, 0); });
   };
 
+  // Verify that the source and destination are ranked types.
+  if (!packOrUnPack.getSourceType().hasRank() ||
+      !packOrUnPack.getDestType().hasRank()) {
+    return op->emitError(
+        "expected both source and destination to be shaped types");
----------------
hanhanW wrote:

```suggestion
        "expected both source and destination to have rank");
```

I think it is more accurate. Because there are unranked shape types.

https://github.com/llvm/llvm-project/blob/e55164ae1098bbf8ceb87b83a4b282b08bb7bef9/mlir/include/mlir/IR/BuiltinTypeInterfaces.td#L119-L122

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


More information about the Mlir-commits mailing list