[Mlir-commits] [mlir] [mlir][linalg] Clean up op verifiers without custom checks(NFC) (PR #168712)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Nov 19 06:33:24 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Longsheng Mou (CoTinker)
<details>
<summary>Changes</summary>
This PR removes op verifiers that do not implement any custom verification logic.
---
Full diff: https://github.com/llvm/llvm-project/pull/168712.diff
2 Files Affected:
- (modified) mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td (-2)
- (modified) mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp (-9)
``````````diff
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
index dfb32a056a4d4..4948bfffad5e0 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
@@ -222,7 +222,6 @@ def GenericOp : LinalgStructuredBase_Op<"generic", [
let hasCanonicalizer = 1;
let hasCustomAssemblyFormat = 1;
let hasFolder = 1;
- let hasVerifier = 1;
}
@@ -620,7 +619,6 @@ def ElementwiseOp : LinalgStructuredBase_Op<"elementwise", [
let hasCustomAssemblyFormat = 1;
let hasFolder = 1;
- let hasVerifier = 1;
let extraClassDeclaration = structuredOpsBaseDecls # [{
/// Get the arity enum corresponding to the kind of op, e.g. if arg is
diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
index 3dc45edf4a23f..f4cf96c771a64 100644
--- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
@@ -1338,8 +1338,6 @@ Speculation::Speculatability GenericOp::getSpeculatability() {
return getGenericSpeculatabilityImpl(cast<LinalgOp>(getOperation()));
}
-LogicalResult GenericOp::verify() { return success(); }
-
namespace {
/// Remove linalg operations that are just copying the values from inputs to
@@ -4885,13 +4883,6 @@ void ElementwiseOp::print(OpAsmPrinter &p) {
elidedAttrs);
}
-LogicalResult ElementwiseOp::verify() {
- // All necessary checks are done either by
- // - EnumAttr (e.g. unknown operation kind)
- // - verifyStructuredOpInterface (incorrect map, sizes).
- return success();
-}
-
/// Implements the block region builder for the ElementwiseOp. This is called by
/// 'fillStructuredOpRegion'.
void ElementwiseOp::regionBuilder(
``````````
</details>
https://github.com/llvm/llvm-project/pull/168712
More information about the Mlir-commits
mailing list