[clang] [CIR] Add cir.fmuladd op lowering to llvm.fmuladd (PR #215329)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 10:59:01 PDT 2026


================
@@ -7757,6 +7757,35 @@ def CIR_FMAOp : CIR_TernaryFPToFPBuiltinOp<"fma", "FMAOp"> {
   }];
 }
 
+def CIR_FMulAddOp : CIR_TernaryFPToFPBuiltinOp<"fmuladd", "FMulAddOp"> {
+  let summary = "Contractable fused multiply-add operation";
+
+  let description = [{
+    Computes `(a * b) + c`, allowing the multiply and add to be fused (or not)
+    into a single rounding step at the target's discretion. It lowers to the
+    `llvm.fmuladd` intrinsic (or its constrained variant when an `fenv`
+    attribute is present).
+
+    Unlike `cir.fma`, which maps to `llvm.fma` and guarantees a single
+    rounding, `cir.fmuladd` expresses the FP-contraction relaxation used for
+    `a * b + c` under `-ffp-contract=on` / `fast`, where the backend is free to
----------------
bcardosolopes wrote:

CIRGen support coming on a new PR? 

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


More information about the cfe-commits mailing list