This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix shrinking of F16 FMA on newer subtargets
ClosedPublic

Authored by foad on Sep 8 2022, 6:51 AM.

Details

Summary

D125803 introduced shrinking of F16 FMA to FMAAK/FMAMK in
SIShrinkInstructions (useful on GFX10+ where VOP3 instructions may have
a literal operand) but failed to handle the V_FMA_F16_gfx9_e64 form of
the opcode which is used on GFX9+.

Diff Detail

Event Timeline

foad created this revision.Sep 8 2022, 6:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2022, 6:51 AM
foad requested review of this revision.Sep 8 2022, 6:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2022, 6:51 AM
Joe_Nash accepted this revision.Sep 8 2022, 7:01 AM
Joe_Nash added a subscriber: Joe_Nash.

LGTM

llvm/test/CodeGen/AMDGPU/gfx10-shrink-mad-fma.mir
195

I guess the test case before was technically invalid, because V_FMA_F16_e64 should not exist on GFX10, only GFX8. But afaik we do not check whether an instruction is valid on the subtarget in SIInstrInfo::verifyInstruction.

This revision is now accepted and ready to land.Sep 8 2022, 7:01 AM
foad added inline comments.Sep 8 2022, 8:24 AM
llvm/test/CodeGen/AMDGPU/gfx10-shrink-mad-fma.mir
195
This revision was landed with ongoing or failed builds.Sep 8 2022, 8:41 AM
This revision was automatically updated to reflect the committed changes.