[clang] [CIR] Implement AddOp for ComplexType (PR #147578)

Henrich Lauko via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 9 00:05:59 PDT 2025


================
@@ -2521,6 +2521,32 @@ def ComplexImagOp : CIR_Op<"complex.imag", [Pure]> {
   let hasFolder = 1;
 }
 
+//===----------------------------------------------------------------------===//
+// ComplexAddOp
+//===----------------------------------------------------------------------===//
+
+def ComplexAddOp : CIR_Op<"complex.add", [Pure, SameOperandsAndResultType]> {
----------------
xlauko wrote:

I am in favor of separate operations too, as it will simplify future optimizations, like specification of commutativity etc.

Sidenote: I would not incline to complex dialect that much, as it might get deprecated, since there is no maintainer still. See: https://discourse.llvm.org/t/mlir-project-maintainers/87189

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


More information about the cfe-commits mailing list