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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Jan 15 15:06:42 PST 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- mlir/include/mlir/Dialect/Utils/VerificationUtils.h mlir/lib/Dialect/Bufferization/IR/BufferizationOps.cpp mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp mlir/lib/Dialect/Tosa/IR/TosaOps.cpp mlir/lib/Dialect/Utils/VerificationUtils.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/include/mlir/Dialect/Utils/VerificationUtils.h b/mlir/include/mlir/Dialect/Utils/VerificationUtils.h
index ba642c11b..3d350aae7 100644
--- a/mlir/include/mlir/Dialect/Utils/VerificationUtils.h
+++ b/mlir/include/mlir/Dialect/Utils/VerificationUtils.h
@@ -29,9 +29,8 @@ LogicalResult verifyDynamicDimensionCount(Operation *op, ShapedType type,
 
 /// Verify that two shaped types have matching ranks. Returns failure and emits
 /// an error if ranks don't match. Unranked types are considered compatible.
-LogicalResult verifyRanksMatch(Operation *op, ShapedType lhs,
-                               ShapedType rhs, StringRef lhsName,
-                               StringRef rhsName);
+LogicalResult verifyRanksMatch(Operation *op, ShapedType lhs, ShapedType rhs,
+                               StringRef lhsName, StringRef rhsName);
 
 } // namespace mlir
 
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
index 7fc13d73d..9402c13da 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
@@ -2135,8 +2135,7 @@ LogicalResult tosa::PadOp::verify() {
   if (!inputType || !outputType)
     return success();
 
-  if (failed(verifyRanksMatch(this, inputType, outputType, "input",
-                              "output")))
+  if (failed(verifyRanksMatch(this, inputType, outputType, "input", "output")))
     return failure();
 
   auto inputRank = inputType.getRank();

``````````

</details>


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


More information about the Mlir-commits mailing list