Hi All,<div><br></div><div>Attached is a patch to aggressively form FMAs from pairs of mul+add and mul+sub instructions during DAG combine. It forms these instructions when:</div><div>(a) AllowExcessFPPrecision is true*.</div>

<div>(b) FMA is legal for the target.</div><div>(c) FMA is cheaper than a separate mul and add.</div><div><br></div><div>* I've hijacked and renamed "DisableExcessFPPrecision" for this patch (new llc command line option: -enable-excess-fp-precision). The comments for that DisableExcessFPPrecision suggest that this was its intended purpose. Under my patch the option still defaults to false, so aggressive FMA formation is now OFF by default. Previously the ARM and PPC targets had been forming FMAs aggressively where the instructions were available (at least on non-Darwin platforms).</div>

<div><br></div><div>Does anybody have any comments or suggestions? Otherwise I'll commit shortly.</div><div><br></div><div>Hal - I've updated the guards on FMA formation for PPC, but by default FMAs will no longer be formed. If this is a problem, would it be possible to have your FMA-formation guard rely on a PPC specific "disable-FMA" option? I'd like to keep AllowExcessFPPrecision as the guard for target independent FMA formation, and that should be off by default.</div>
<div><br></div><div>- Lang.</div><div><br></div><div>p.s Will be adding a clang command line option for this just as soon as I work out what to call it. Taking suggestions...</div>