[Mlir-commits] [mlir] [mlir][vector] Allow 0-D vector acc/res in `vector.contract` (PR #234638)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 22 23:30:11 PDT 2026


================
@@ -1081,9 +1081,14 @@ static LogicalResult verifyOutputShape(
 
   // Verify 'expectedResultDims'.
   if (expectedResultDims.empty()) {
-    // No batch or free dimension implies a scalar result.
-    if (llvm::isa<VectorType>(resType) || llvm::isa<VectorType>(accType))
-      return op.emitOpError("invalid accumulator/result vector shape");
+    // No batch or free dimension implies a scalar or 0-D vector result. The
+    // accumulator and the result must agree.
+    if (resType != accType)
+      return op.emitOpError("expected accumulator and result to have the same "
+                            "type");
----------------
StarOne01 wrote:

nit 😅, when i see the "type" seperately, i thought it is some variable.

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


More information about the Mlir-commits mailing list