This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SDAG: Factor out the fold (add (mul x, y), y) --> mad_[iu]64_[iu]32
ClosedPublic

Authored by nhaehnle on Apr 14 2022, 9:39 PM.

Details

Summary

Refactor to simplify a follow-up change.

No functional change intended. However, there is a rather subtle logic
change: the subsequent combines (e.g. reassociation) are skipped *always*
when one of the operands of the add is a mul, instead of only when
additionally mad64_32 etc. are available. This change makes sense because
the subsequent combines should never apply when one of the operands is a
mul.

Diff Detail

Event Timeline

nhaehnle created this revision.Apr 14 2022, 9:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2022, 9:39 PM
nhaehnle requested review of this revision.Apr 14 2022, 9:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2022, 9:39 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm accepted this revision.Apr 15 2022, 7:06 AM

LGTM. Can I convince you to port this optimization to GlobalISel?

This revision is now accepted and ready to land.Apr 15 2022, 7:06 AM

LGTM. Can I convince you to port this optimization to GlobalISel?

Does this apply to the second part as well? I'll start taking a look at the GlobalISel part over the next week or so, but I'm pretty sure it should be a separate change.

LGTM. Can I convince you to port this optimization to GlobalISel?

Does this apply to the second part as well? I'll start taking a look at the GlobalISel part over the next week or so, but I'm pretty sure it should be a separate change.

Of course, just need to start chipping away at the deltas

This revision was landed with ongoing or failed builds.May 2 2022, 3:40 PM
This revision was automatically updated to reflect the committed changes.