Hi All,<div><br></div><div>I want to improve Clang/LLVM's support for the fp_contract pragma. (Background: when the fp_contract pragma is ON, multiplications and additions within expressions can be fused to FMAs. This is a performance win on targets that have a fast fma instruction.)</div>

<div><br></div><div>As a step towards implementing this functionality, this patch adds a new family of intrinsics, llvm.fmuladd.*, that represent mul+add expressions that can be fused. The frontend will emit calls to these intrinsics when it sees a mul+add in a single source expression and fp_contract is ON (I'll mail a patch for this functionality to cfe-commits in a minute). During isel, the legalizer will check the Subtarget::isFMACheap() method to decide whether to lower these intrinsics to llvm.fma.* intrinsic calls, or a regular unfused mul and add expression.</div>

<div><br></div><div>I haven't taught the optimizers to reason about these expressions yet - that's coming next. For now I just wanted to see if anyone had any objections to the proposed scheme. If not I'll go ahead and commit.</div>

<div><br></div><div>Cheers,</div><div>Lang.</div>