[mlir][vector] Limit vector.mask op to single vector result
authorMatthias Springer <springerm@google.com>
Wed, 18 Jan 2023 14:55:13 +0000 (15:55 +0100)
committerMatthias Springer <springerm@google.com>
Wed, 18 Jan 2023 14:55:13 +0000 (15:55 +0100)
Multiple vector results require multiple masks and passthru values.

Depends On: D141683

Differential Revision: https://reviews.llvm.org/D141786

mlir/lib/Dialect/Vector/IR/VectorOps.cpp

index 387f003..777133d 100644 (file)
@@ -5418,6 +5418,10 @@ LogicalResult MaskOp::verify() {
     return emitOpError(
         "expects result type to match maskable operation result type");
 
+  if (llvm::count_if(maskableOp->getResultTypes(),
+                     [](Type t) { return t.isa<VectorType>(); }) > 1)
+    return emitOpError("multiple vector results not supported");
+
   // Mask checks.
   Type expectedMaskType = maskableOp.getExpectedMaskType();
   if (getMask().getType() != expectedMaskType)