[Mlir-commits] [mlir] [mlir][vector] Restrict vector.shape_cast (scalable vectors) (PR #100331)

Jakub Kuderski llvmlistbot at llvm.org
Wed Jul 24 11:16:04 PDT 2024


================
@@ -5238,6 +5238,13 @@ static LogicalResult verifyVectorShapeCast(Operation *op,
     if (!isValidShapeCast(resultShape, sourceShape))
       return op->emitOpError("invalid shape cast");
   }
+
+  // Check that (non-)scalability is preserved
+  if (sourceVectorType.getNumScalableDims() !=
+      resultVectorType.getNumScalableDims())
+    return op->emitOpError("non-matching scalable dims");
----------------
kuhar wrote:

You could make it more descriptive and say what is non-matching, e.g.:
`non-matching number of scalable dims at source (2) and result (1)`

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


More information about the Mlir-commits mailing list