[Mlir-commits] [mlir] [mlir][tosa] Remove unnecessary conv verifier checks (PR #231825)
Luke Hutton
llvmlistbot at llvm.org
Wed Oct 14 02:17:37 PDT 2026
https://github.com/lhutton1 created https://github.com/llvm/llvm-project/pull/231825
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.
>From e7301dfc7bf3c6c71fcb921a16b5fb3efc85aa27 Mon Sep 17 00:00:00 2001
From: Luke Hutton <luke.hutton at arm.com>
Date: Wed, 14 Oct 2026 10:13:33 +0100
Subject: [PATCH] [mlir][tosa] Remove unnecessary conv verifier checks
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.
Change-Id: I529a2a0d80d5ebeb0595fceb0441e4503e3db327
---
mlir/lib/Dialect/Tosa/IR/TosaOps.cpp | 28 ++++------------------------
1 file changed, 4 insertions(+), 24 deletions(-)
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();
More information about the Mlir-commits
mailing list