[clang] [CIR] Implement cir.cmp3way Operation (PR #186294)

Zaky Hermawan via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 12 19:50:03 PDT 2026


================
@@ -326,7 +324,47 @@ class AggExprEmitter : public StmtVisitor<AggExprEmitter> {
     Visit(e->getRHS());
   }
   void VisitBinCmp(const BinaryOperator *e) {
-    cgf.cgm.errorNYI(e->getSourceRange(), "AggExprEmitter: VisitBinCmp");
+    const ComparisonCategoryInfo &CompCategoryInfo =
+        cgf.getContext().CompCategories.getInfoForType(e->getType());
+
+    QualType ArgTy = e->getLHS()->getType();
+    if (ArgTy->isIntegralOrEnumerationType() || ArgTy->isRealFloatingType() ||
+        ArgTy->isNullPtrType() || ArgTy->isPointerType() ||
+        ArgTy->isMemberPointerType()) {
+      mlir::Value lhs = cgf.emitScalarExpr(e->getLHS());
+      mlir::Value rhs = cgf.emitScalarExpr(e->getRHS());
----------------
ZakyHermawan wrote:

Is it guaranteed that the lhs has the same type as the rhs at this point ?
If not, maybe we need to check it.

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


More information about the cfe-commits mailing list