Skip to content

Conversation

@Andres-Salamanca
Copy link
Contributor

The empty verifier is redundant because cir::IfOp has no constraints to enforce its verify() always succeeds.

@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels May 18, 2025
@Andres-Salamanca
Copy link
Contributor Author

@andykaylor

@llvmbot
Copy link
Member

llvmbot commented May 18, 2025

@llvm/pr-subscribers-clang

Author: None (Andres-Salamanca)

Changes

The empty verifier is redundant because cir::IfOp has no constraints to enforce its verify() always succeeds.


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

2 Files Affected:

  • (modified) clang/include/clang/CIR/Dialect/IR/CIROps.td (-1)
  • (modified) clang/lib/CIR/Dialect/IR/CIRDialect.cpp (-2)
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
 //===----------------------------------------------------------------------===//

@llvmbot
Copy link
Member

llvmbot commented May 18, 2025

@llvm/pr-subscribers-clangir

Author: None (Andres-Salamanca)

Changes

The empty verifier is redundant because cir::IfOp has no constraints to enforce its verify() always succeeds.


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

2 Files Affected:

  • (modified) clang/include/clang/CIR/Dialect/IR/CIROps.td (-1)
  • (modified) clang/lib/CIR/Dialect/IR/CIRDialect.cpp (-2)
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
 //===----------------------------------------------------------------------===//

Copy link
Contributor

@andykaylor andykaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@andykaylor andykaylor merged commit 114e450 into llvm:main May 19, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants