[Mlir-commits] [mlir] [mlir][Utils] Add verifyRanksMatch helper (NFC) (PR #175880)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Jan 15 11:50:10 PST 2026


================
@@ -2126,13 +2127,11 @@ LogicalResult tosa::PadOp::verify() {
   if (!inputType || !outputType)
     return success();
 
-  auto inputRank = inputType.getRank();
-  auto outputRank = outputType.getRank();
-  if (inputRank != outputRank)
-    return emitOpError() << "expect same input and output tensor rank, but got "
-                         << "inputRank: " << inputRank
-                         << ", outputRank: " << outputRank;
+  if (failed(verifyRanksMatch(getOperation(), inputType, outputType, "input",
----------------
banach-space wrote:

```suggestion
  if (failed(verifyRanksMatch(this, inputType, outputType, "input",
```

Similar suggestion elsewhere. Unless I am missing something?

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


More information about the Mlir-commits mailing list