This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Simplify mad/mac patterns. NFC.
ClosedPublic

Authored by foad on Sep 5 2022, 7:49 AM.

Details

Reviewers
rampitec
Group Reviewers
Restricted Project
Commits
rG5291c3dd3683: [AMDGPU] Simplify mad/mac patterns. NFC.
Summary

Simplify instruction selection patterns for mad/mac:

  • Use any_fmad consistently to make it clear that all patterns treat fmad and AMDGPUfmad_ftz identically.
  • For mad, put the patterns on the instruction definitions. For mac the patterns are still out-of-line because we want to set AddedComplexity and to have special handling of the source modifiers.

Diff Detail

Event Timeline

foad created this revision.Sep 5 2022, 7:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2022, 7:49 AM
foad requested review of this revision.Sep 5 2022, 7:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 5 2022, 7:49 AM
rampitec accepted this revision.Sep 6 2022, 12:23 PM
rampitec added a subscriber: rampitec.

LGTM

This revision is now accepted and ready to land.Sep 6 2022, 12:23 PM
This revision was automatically updated to reflect the committed changes.
arsenm added inline comments.Sep 9 2022, 6:57 AM
llvm/lib/Target/AMDGPU/SIInstructions.td
987

If we keep the node parameter, can we reuse this for v_fmac_*?

foad added inline comments.Sep 9 2022, 7:56 AM
llvm/lib/Target/AMDGPU/SIInstructions.td
987

Not sure - it looks like V_FMAC_* lack the clamp and omod operands.