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

Jakub Kuderski llvmlistbot at llvm.org
Wed Jul 24 13:55:34 PDT 2024


================
@@ -5240,9 +5240,12 @@ static LogicalResult verifyVectorShapeCast(Operation *op,
   }
 
   // Check that (non-)scalability is preserved
-  if (sourceVectorType.getNumScalableDims() !=
-      resultVectorType.getNumScalableDims())
-    return op->emitOpError("non-matching scalable dims");
+  auto sourceNScalableDims = sourceVectorType.getNumScalableDims();
+  auto resultNScalableDims = resultVectorType.getNumScalableDims();
----------------
kuhar wrote:

nit: do not use auto when the type is not obvious based on the RHS only

```suggestion
  int64_t sourceNScalableDims = sourceVectorType.getNumScalableDims();
  int64_t resultNScalableDims = resultVectorType.getNumScalableDims();
```



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


More information about the Mlir-commits mailing list