[Mlir-commits] [mlir] [mlir][tosa] Remove unnecessary conv verifier checks (PR #231825)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Oct 14 02:18:21 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-tosa

Author: Luke Hutton (lhutton1)

<details>
<summary>Changes</summary>

The `verifyConvOpModes` function wasn't verifying anything. Likely this was left behind when the verifier was relaxed to stop checking accumulation type alignment with input/output types. This commit removes the unnecessary function call.

---
Full diff: https://github.com/llvm/llvm-project/pull/231825.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/Tosa/IR/TosaOps.cpp (+4-24) 


``````````diff
diff --git a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
index dd6ce622c4646..838d039cb2c24 100644
--- a/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
+++ b/mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
@@ -797,23 +797,6 @@ LogicalResult tosa::ConstOp::verify() {
   return success();
 }
 
-template <typename T>
-static LogicalResult verifyConvOpModes(T op) {
-  auto inputEType =
-      llvm::cast<ShapedType>(op.getInput().getType()).getElementType();
-
-  if (auto quantType = llvm::dyn_cast<mlir::quant::QuantizedType>(inputEType))
-    inputEType = getStorageElementTypeFromQuantized(quantType);
-
-  auto resultEType =
-      llvm::cast<ShapedType>(op.getResult().getType()).getElementType();
-
-  if (auto quantType = llvm::dyn_cast<mlir::quant::QuantizedType>(resultEType))
-    resultEType = getStorageElementTypeFromQuantized(quantType);
-
-  return success();
-}
-
 //===----------------------------------------------------------------------===//
 // ERROR_IF functions.
 // ERROR_IF is a predicate that must set an error if the condition holds.
@@ -4513,8 +4496,7 @@ LogicalResult Conv2DOp::inferReturnTypeComponents(
 }
 
 LogicalResult Conv2DOp::verify() {
-  if (verifyConvOp(*this).failed() || verifyConvOpModes(*this).failed() ||
-      verifyConvOpErrorIf(*this).failed())
+  if (verifyConvOp(*this).failed() || verifyConvOpErrorIf(*this).failed())
     return failure();
   return success();
 }
@@ -4673,8 +4655,7 @@ LogicalResult Conv3DOp::inferReturnTypeComponents(
 }
 
 LogicalResult Conv3DOp::verify() {
-  if (verifyConvOp(*this).failed() || verifyConvOpModes(*this).failed() ||
-      verifyConvOpErrorIf(*this).failed())
+  if (verifyConvOp(*this).failed() || verifyConvOpErrorIf(*this).failed())
     return failure();
   return success();
 }
@@ -4853,8 +4834,7 @@ LogicalResult DepthwiseConv2DOp::inferReturnTypeComponents(
 }
 
 LogicalResult DepthwiseConv2DOp::verify() {
-  if (verifyConvOp(*this).failed() || verifyConvOpModes(*this).failed() ||
-      verifyConvOpErrorIf(*this).failed())
+  if (verifyConvOp(*this).failed() || verifyConvOpErrorIf(*this).failed())
     return failure();
   return success();
 }
@@ -4920,7 +4900,7 @@ LogicalResult TransposeConv2DOp::inferReturnTypeComponents(
 }
 
 LogicalResult TransposeConv2DOp::verify() {
-  if (verifyConvOp(*this).failed() || verifyConvOpModes(*this).failed())
+  if (verifyConvOp(*this).failed())
     return failure();
 
   const llvm::ArrayRef<int64_t> strides = getStride();

``````````

</details>


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


More information about the Mlir-commits mailing list