This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Prefer v_fmac over v_fma only when no source modifiers are used
ClosedPublic

Authored by foad on Sep 20 2021, 6:51 AM.

Details

Summary

v_fmac with source modifiers forces VOP3 encoding, but it is strictly
better to use the VOP3-only v_fma instead, because $dst and $src2 are
not tied so it gives the register allocator more freedom and avoids a
copy in some cases.

This is the same strategy we already use for v_mad vs v_mac and
v_fma_legacy vs v_fmac_legacy.

Diff Detail

Event Timeline

foad created this revision.Sep 20 2021, 6:51 AM
foad requested review of this revision.Sep 20 2021, 6:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2021, 6:51 AM
rampitec accepted this revision.Sep 20 2021, 4:48 PM
This revision is now accepted and ready to land.Sep 20 2021, 4:48 PM
arsenm accepted this revision.Sep 20 2021, 4:49 PM
This revision was landed with ongoing or failed builds.Sep 21 2021, 4:03 AM
This revision was automatically updated to reflect the committed changes.