[Mlir-commits] [mlir] [mlir][Utils] Add verifyIndexCount helper (NFC) (PR #176678)

Andrzej WarzyƄski llvmlistbot at llvm.org
Wed Jan 21 08:52:37 PST 2026


================
@@ -5462,8 +5463,8 @@ LogicalResult TransferWriteOp::verify() {
       maskType ? inferTransferOpMaskType(vectorType, permutationMap)
                : VectorType();
 
-  if (llvm::size(getIndices()) != shapedType.getRank())
-    return emitOpError("requires ") << shapedType.getRank() << " indices";
+  if (failed(verifyIndexCount(*this, shapedType, llvm::size(getIndices()))))
----------------
banach-space wrote:

Why not use  `.size()` in all the cases?
```suggestion
  if (failed(verifyIndexCount(*this, shapedType, llvm::size(getIndices().size()))))
```

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


More information about the Mlir-commits mailing list