[clang] [CIR] Remove the empty verifier in cir.ifOp (PR #140457)
via cfe-commits
cfe-commits at lists.llvm.org
Sun May 18 08:36:58 PDT 2025
https://github.com/Andres-Salamanca created https://github.com/llvm/llvm-project/pull/140457
The empty verifier is redundant because cir::IfOp has no constraints to enforce its verify() always succeeds.
>From f482141df1f2174bdd9a23ddc20bb9530830071d Mon Sep 17 00:00:00 2001
From: Andres Salamanca <andrealebarbaritos at gmail.com>
Date: Sun, 18 May 2025 10:33:22 -0500
Subject: [PATCH] Remove the empty verifier in cir.ifOp
---
clang/include/clang/CIR/Dialect/IR/CIROps.td | 1 -
clang/lib/CIR/Dialect/IR/CIRDialect.cpp | 2 --
2 files changed, 3 deletions(-)
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index 71b9a816669bc..d3411973129a4 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -553,7 +553,6 @@ def IfOp : CIR_Op<"if",
let arguments = (ins CIR_BoolType:$condition);
let regions = (region AnyRegion:$thenRegion, AnyRegion:$elseRegion);
let hasCustomAssemblyFormat=1;
- let hasVerifier=1;
let skipDefaultBuilders=1;
let builders = [
OpBuilder<(ins "mlir::Value":$cond, "bool":$withElseRegion,
diff --git a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
index 9c80c48fa4039..bd1aa1f4fe5bb 100644
--- a/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+++ b/clang/lib/CIR/Dialect/IR/CIRDialect.cpp
@@ -751,8 +751,6 @@ void cir::IfOp::build(OpBuilder &builder, OperationState &result, Value cond,
elseBuilder(builder, result.location);
}
-LogicalResult cir::IfOp::verify() { return success(); }
-
//===----------------------------------------------------------------------===//
// ScopeOp
//===----------------------------------------------------------------------===//
More information about the cfe-commits
mailing list