This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Convert mac/fmac to mad/fma when folding output modifiers
ClosedPublic

Authored by foad on Sep 21 2021, 5:10 AM.

Details

Summary

Use of output modifiers forces VOP3 encoding for a VOP2 mac/fmac
instruction, so we might as well convert it to the more flexible VOP3-
only mad/fma form.

With this change, the only way we should emit VOP3-encoded mac/fmac is
if regalloc chooses registers that require the VOP3 encoding, e.g. sgprs
for both src0 and src1. In all other cases the mac/fmac should either be
converted to mad/fma or shrunk to VOP2 encoding.

Diff Detail

Event Timeline

foad created this revision.Sep 21 2021, 5:10 AM
foad requested review of this revision.Sep 21 2021, 5:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2021, 5:10 AM
arsenm accepted this revision.Sep 21 2021, 8:21 AM
This revision is now accepted and ready to land.Sep 21 2021, 8:21 AM