InstCombine: fsub nsz 0, X ==> fsub nsz -0.0, X
authorSanjay Patel <spatel@rotateright.com>
Wed, 31 Dec 2014 22:14:05 +0000 (22:14 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 31 Dec 2014 22:14:05 +0000 (22:14 +0000)
commit28650b8ec29161f0ba8c6c214501d5ef2505a206
tree248073676bf11138275f40331dbcdc1e70999a9b
parent8093abb7454e5419e121bd105487dfa231f35b37
InstCombine: fsub nsz 0, X ==> fsub nsz -0.0, X

Some day the backend may handle instruction-level fast math flags and make
this transform unnecessary, but it's still better practice to use the canonical
representation of fneg when possible (use a -0.0).

This is a partial fix for PR20870 ( http://llvm.org/bugs/show_bug.cgi?id=20870 ).
See also http://reviews.llvm.org/D6723.

Differential Revision: http://reviews.llvm.org/D6731

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225050 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/fast-math.ll