[clang] [CIR] Support type deduction builder for BinaryFPToFPBuiltinOp (PR #226876)

via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 27 20:37:15 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clangir

Author: aokblast

<details>
<summary>Changes</summary>

For external consumer, it would be easier to have constructor without type parameter. As a result, we add a new builder, which can deduct type from lhs directly.

As emitBinaryFPBuiltin is the only consumer for CIR Codegen, it is fine for internal usage.

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


1 Files Affected:

- (modified) clang/include/clang/CIR/Dialect/IR/CIROps.td (+4-1) 


``````````diff
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index c1ba78eea2835..70fa617a18913 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -7842,7 +7842,10 @@ class CIR_BinaryFPToFPBuiltinOp<string mnemonic, string llvmOpName>
     OpBuilder<(ins "mlir::Type":$result, "mlir::Value":$lhs,
                    "mlir::Value":$rhs), [{
       build($_builder, $_state, result, lhs, rhs, cir::FenvAttr{});
-    }]>
+    }]>,
+    OpBuilder<(ins "mlir::Value":$lhs, "mlir::Value":$rhs), [{
+      build($_builder, $_state, lhs, rhs, cir::FenvAttr{});
+    }]
   ];
 
   let llvmOp = llvmOpName;

``````````

</details>


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


More information about the cfe-commits mailing list