This is an archive of the discontinued LLVM Phabricator instance.

Remove BinaryOperator::CreateFNeg
ClosedPublic

Authored by simoll on Feb 25 2020, 11:27 AM.

Details

Summary

With the introduction of the native fneg instruction, the
fsub -0.0, %x idiom is obsolete. This patch makes LLVM
emit fneg instead of the idiom in all places.

Diff Detail

Event Timeline

simoll created this revision.Feb 25 2020, 11:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 25 2020, 11:27 AM
simoll updated this revision to Diff 246544.Feb 25 2020, 12:30 PM
  • rebased
  • fixed clang complex-math test
Herald added a project: Restricted Project. · View Herald TranscriptFeb 25 2020, 12:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
xbolva00 added inline comments.Feb 25 2020, 1:02 PM
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
341

What about this TODO?

simoll marked an inline comment as done.Feb 25 2020, 1:51 PM
simoll added inline comments.
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
341

Ok. So this seems to be a hack to update the FSub idiom on the fly.
How about we get rid of the TODO and the code below in a separate patch?

xbolva00 added inline comments.Feb 25 2020, 1:56 PM
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
341

I agree

cameron.mcinally accepted this revision.Feb 26 2020, 7:28 AM

LGTM, with the TODO to be handled under a separate patch.

Thank you for taking care of this, Simon.

llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
341

+1

This revision is now accepted and ready to land.Feb 26 2020, 7:28 AM
simoll updated this revision to Diff 246974.Feb 27 2020, 9:05 AM
  • rebased
This revision was automatically updated to reflect the committed changes.