This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner] Don't expand (neg (abs x)) if the abs has an additional user.
ClosedPublic

Authored by craig.topper on Feb 24 2022, 12:47 PM.

Details

Summary

If the types aren't legal, the expansions may get type legalized in a
different way preventing code sharing. If the type is legal, we will
share some instructions between the two expansions, but we will need an
extra register.

Since we don't appear to fold (neg (sub A, B)) if the sub has an
additional user, I think it makes sense not to expand NABS.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 24 2022, 12:47 PM
craig.topper requested review of this revision.Feb 24 2022, 12:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 24 2022, 12:47 PM
RKSimon accepted this revision.Mar 1 2022, 3:57 AM

LGTM

This revision is now accepted and ready to land.Mar 1 2022, 3:57 AM
This revision was landed with ongoing or failed builds.Mar 1 2022, 7:32 AM
This revision was automatically updated to reflect the committed changes.