This is an archive of the discontinued LLVM Phabricator instance.

[FPEnv][InstSimplify] 0.0 - -X ==> X
ClosedPublic

Authored by kpn on Aug 10 2022, 11:32 AM.

Details

Summary

Another ticket split out of D107285, this extends the optimization of 0.0 - -X to just X when using constrained intrinsics and the optimization is allowed.

If the negation of X is done with fsub then the match fails because of the lack of IR Matcher support for constrained intrinsics.

While I'm here, remove some TODO notices since the work is no longer planned.

Diff Detail

Event Timeline

kpn created this revision.Aug 10 2022, 11:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2022, 11:32 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
kpn requested review of this revision.Aug 10 2022, 11:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2022, 11:32 AM
spatel accepted this revision.Aug 10 2022, 12:00 PM

LGTM

llvm/test/Transforms/InstSimplify/strictfp-fsub.ll
397

Remove this TODO line?

This revision is now accepted and ready to land.Aug 10 2022, 12:00 PM
This revision was landed with ongoing or failed builds.Aug 11 2022, 8:36 AM
This revision was automatically updated to reflect the committed changes.