[clang] [CIR] Support type deduction builder for BinaryFPToFPBuiltinOp (PR #226876)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 27 20:50:32 PDT 2026
https://github.com/aokblast updated https://github.com/llvm/llvm-project/pull/226876
>From e3576a8fb9edd2c63f80c9fb39a4f326343fd0aa Mon Sep 17 00:00:00 2001
From: ShengYi Hung <aokblast at FreeBSD.org>
Date: Sun, 27 Sep 2026 22:33:07 -0500
Subject: [PATCH] [CIR] Support type deduction builder for
BinaryFPToFPBuiltinOp
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.
---
clang/include/clang/CIR/Dialect/IR/CIROps.td | 3 +++
1 file changed, 3 insertions(+)
diff --git a/clang/include/clang/CIR/Dialect/IR/CIROps.td b/clang/include/clang/CIR/Dialect/IR/CIROps.td
index c1ba78eea2835..31e89407a5e64 100644
--- a/clang/include/clang/CIR/Dialect/IR/CIROps.td
+++ b/clang/include/clang/CIR/Dialect/IR/CIROps.td
@@ -7842,6 +7842,9 @@ 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{});
}]>
];
More information about the cfe-commits
mailing list