This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix an assertion failure when folding into src2 of V_FMAC_F16
ClosedPublic

Authored by foad on Feb 22 2023, 5:44 AM.

Details

Summary

D139469 "[AMDGPU] Enable OMod on more VOP3 instructions" caused an
assertion failure when trying to fold into src2 of V_FMAC_F16. It would
temporarily convert the instruction to V_FMA_F16_gfx9 and add an opsel
operand, but if the fold still failed then it would forget to remove the
opsel operand.

Diff Detail

Event Timeline

foad created this revision.Feb 22 2023, 5:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2023, 5:44 AM
foad requested review of this revision.Feb 22 2023, 5:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 22 2023, 5:44 AM
arsenm accepted this revision.Feb 22 2023, 5:51 AM
arsenm added inline comments.
llvm/test/CodeGen/AMDGPU/fma.f16.ll
145

Is it worth adding the same test for <2 x half>?

This revision is now accepted and ready to land.Feb 22 2023, 5:51 AM
This revision was landed with ongoing or failed builds.Feb 22 2023, 6:26 AM
This revision was automatically updated to reflect the committed changes.
foad marked an inline comment as done.Feb 22 2023, 6:26 AM
foad added inline comments.
llvm/test/CodeGen/AMDGPU/fma.f16.ll
145

Sure, done.