[clang] [CIR] Upstream ComplexRealPtrOp for ComplexType (PR #144235)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 16 12:06:28 PDT 2025


================
@@ -2385,4 +2385,33 @@ def ComplexCreateOp : CIR_Op<"complex.create", [Pure, SameTypeOperands]> {
   let hasFolder = 1;
 }
 
+//===----------------------------------------------------------------------===//
+// ComplexRealPtrOp
+//===----------------------------------------------------------------------===//
+
+def ComplexRealPtrOp : CIR_Op<"complex.real_ptr", [Pure]> {
+  let summary = "Derive a pointer to the real part of a complex value";
+  let description = [{
+    `cir.complex.real_ptr` operation takes a pointer operand that points to a
+    complex value of type `!cir.complex` and yields a pointer to the real part
+    of the operand.
+
+    Example:
+
+    ```mlir
+    %1 = cir.complex.real_ptr %0 : !cir.ptr<!cir.complex<!cir.double>> -> !cir.ptr<!cir.double>
----------------
andykaylor wrote:

Reformat this for 80 columns.

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


More information about the cfe-commits mailing list