[clang] [CIR] Implement NotEqualOp for ComplexType (PR #146129)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 28 01:49:27 PDT 2025


================
@@ -901,13 +901,9 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {
       assert(e->getOpcode() == BO_EQ || e->getOpcode() == BO_NE);
 
       BinOpInfo boInfo = emitBinOps(e);
-      if (e->getOpcode() == BO_EQ) {
-        result =
-            builder.create<cir::ComplexEqualOp>(loc, boInfo.lhs, boInfo.rhs);
-      } else {
-        result =
-            builder.create<cir::ComplexNotEqualOp>(loc, boInfo.lhs, boInfo.rhs);
-      }
+      cir::CmpOpKind opKind =
+          e->getOpcode() == BO_EQ ? cir::CmpOpKind::eq : cir::CmpOpKind::ne;
+      result = builder.create<cir::CmpOp>(loc, opKind, boInfo.lhs, boInfo.rhs);
----------------
xlauko wrote:

```suggestion
      result = builder.create<cir::CmpOp>(loc, kind, boInfo.lhs, boInfo.rhs);
```

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


More information about the cfe-commits mailing list