Teach GetNegatedExpression to negate 0-B to B in UnsafeFPMath mode, and
authorDan Gohman <gohman@apple.com>
Mon, 2 Jul 2007 15:48:56 +0000 (15:48 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 2 Jul 2007 15:48:56 +0000 (15:48 +0000)
commit23ff1826b9c848c0627747f3de976b6c99c94b4b
treefed63e88f12981fce8fface18d5a27ec5a41abae
parent03de31acaea8f549e9a957a0b5231bcbc719df0a
Teach GetNegatedExpression to negate 0-B to B in UnsafeFPMath mode, and
visitFSUB to fold 0-B to -B in UnsafeFPMath mode. Also change visitFNEG
to use isNegatibleForFree/GetNegatedExpression instead of doing a subset
of the same thing manually.

This fixes test/CodeGen/X86/negative-sin.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37842 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp