[PATCH] Allow FMAs in safe math mode in some cases when one operand of the fmul is either exactly 0.0 or exactly 1.0.

Joerg Sonnenberger joerg at britannica.bec.de
Tue Jul 9 23:55:29 PDT 2013


On Tue, Jul 09, 2013 at 01:44:04PM -0700, Stephen Lin wrote:
> The attached patch allows FMAs to be formed in DAGCombiner even
> without unsafe math mode when one operand is known to be either 0.0 or
> 1.0 exactly (this is safe because no rounding occurs in the fmul step,
> and behavior on all limit case inputs is preserved, as far as I can
> tell.)

What is the behavior of FMA if the intermediate result overflows?
E.g. what does 2 * __DBL_MAX__ - __DBL_MAX__ give as FMA?

Joerg



More information about the llvm-commits mailing list