This is an archive of the discontinued LLVM Phabricator instance.

InstCombine: Handle shrinking fneg used by fptrunc
AbandonedPublic

Authored by arsenm on May 7 2023, 1:04 PM.

Details

Summary

This would have regressed when the fsub special case was dropped

Diff Detail

Event Timeline

arsenm created this revision.May 7 2023, 1:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 7 2023, 1:04 PM
arsenm requested review of this revision.May 7 2023, 1:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 7 2023, 1:04 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm retitled this revision from InstCombine: Handle shrinking fneg with fpext source to InstCombine: Handle shrinking fneg of fptrunc .May 7 2023, 1:08 PM
arsenm retitled this revision from InstCombine: Handle shrinking fneg of fptrunc to InstCombine: Handle shrinking fneg used by fptrunc.
foad added a comment.May 9 2023, 6:36 AM

This would have regressed when the fsub special case was dropped

What happened? Got a link to a patch?

arsenm added a comment.May 9 2023, 6:37 AM

This would have regressed when the fsub special case was dropped

What happened? Got a link to a patch?

fneg used to not exist and we had fsub -0, x = "fneg"

foad accepted this revision.May 9 2023, 6:42 AM

Right. LGTM. Should probably handle fabs too?

This revision is now accepted and ready to land.May 9 2023, 6:42 AM
arsenm added a comment.May 9 2023, 6:45 AM

Right. LGTM. Should probably handle fabs too?

It's already handled under the unary intrinsic case

foad added inline comments.May 9 2023, 7:34 AM
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
1744

This comment seems misplaced.

1753

Now I'm confused. What does this code handle and how is it different from what you added?

arsenm abandoned this revision.May 18 2023, 10:19 AM
arsenm added inline comments.
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
1753

I'm confused too, I saw these not fold in a test but the tests I added work without this