This is an archive of the discontinued LLVM Phabricator instance.

InstCombine: fsub nsz 0, X ==> fsub nsz -0.0, X
ClosedPublic

Authored by spatel on Dec 18 2014, 2:44 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 17473.Dec 18 2014, 2:44 PM
spatel retitled this revision from to InstCombine: fsub nsz 0, X ==> fsub nsz -0.0, X.
spatel updated this object.
spatel edited the test plan for this revision. (Show Details)
spatel added reviewers: hfinkel, majnemer, resistor.
spatel added a subscriber: Unknown Object (MLST).
hfinkel accepted this revision.Dec 23 2014, 3:40 PM
hfinkel edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Dec 23 2014, 3:40 PM
This revision was automatically updated to reflect the committed changes.