[llvm] r199420 - Teach InstCombine that (fmul X, -1.0) can be simplified to (fneg X), which LLVM expresses as (fsub -0.0, X).

Joerg Sonnenberger joerg at britannica.bec.de
Thu Jan 16 14:25:22 PST 2014


On Thu, Jan 16, 2014 at 02:19:59PM -0800, Philip Reames wrote:
> Could you give a quick justification on why this is a correct
> optimization?  I'm not saying it's wrong, but given the complexity
> of floating point it doesn't seem obviously correct either.

Negation is exacty.

Joerg



More information about the llvm-commits mailing list