[AMDGPU] Fix an assertion failure when folding into src2 of V_FMAC_F16
authorJay Foad <jay.foad@amd.com>
Wed, 22 Feb 2023 13:39:58 +0000 (13:39 +0000)
committerJay Foad <jay.foad@amd.com>
Wed, 22 Feb 2023 14:26:03 +0000 (14:26 +0000)
commite2eee902a41671c6dc67128e20af6c8f1dec55aa
tree599e025a634b2aa47a728f43ae9a5207761fe56c
parent200034978b95e376814de25a7ea6e4da3b3359d0
[AMDGPU] Fix an assertion failure when folding into src2 of V_FMAC_F16

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.

Differential Revision: https://reviews.llvm.org/D144558
llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
llvm/test/CodeGen/AMDGPU/fma.f16.ll