This is an archive of the discontinued LLVM Phabricator instance.

[FPEnv][InstSimplify] Fold fsub X, -0 ==> X, when we know X is not -0
ClosedPublic

Authored by kpn on Feb 14 2022, 10:58 AM.

Details

Summary

Currently the fsub optimizations in InstSimplify don't know how to fold X - -0.0 to X when we know X is not zero and the constrained intrinsics are used. This adds the support.

This review is split out from D107285.

Diff Detail

Event Timeline

kpn created this revision.Feb 14 2022, 10:58 AM
kpn requested review of this revision.Feb 14 2022, 10:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 10:58 AM
spatel accepted this revision.Feb 15 2022, 10:32 AM

"X - (-0.0)" should be equivalent to the existing code for "X + 0.0", so LGTM.

This revision is now accepted and ready to land.Feb 15 2022, 10:32 AM
This revision was landed with ongoing or failed builds.Feb 16 2022, 7:10 AM
This revision was automatically updated to reflect the committed changes.