[AMDGPU] Shrink MAD/FMA to MADAK/MADMK/FMAAK/FMAMK on GFX10
authorJay Foad <jay.foad@amd.com>
Fri, 18 Feb 2022 17:24:50 +0000 (17:24 +0000)
committerJay Foad <jay.foad@amd.com>
Mon, 16 May 2022 14:15:23 +0000 (15:15 +0100)
commit27fa41583fdee54d40ae680408f697e6d8201a8c
treea7860942b3b3cede92eb597b3e833709227a354e
parent8ab819ad90d647b96bb4b6842a742d2552ba9e9c
[AMDGPU] Shrink MAD/FMA to MADAK/MADMK/FMAAK/FMAMK on GFX10

On GFX10 VOP3 instructions can have a literal operand, so the conversion
from VOP3 MAD/FMA to VOP2 MADAK/MADMK/FMAAK/FMAMK will not happen in
SIFoldOperands. The only benefit of the VOP2 form is code size, so do it
in SIShrinkInstructions instead.

Differential Revision: https://reviews.llvm.org/D125567
llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
llvm/test/CodeGen/AMDGPU/dagcombine-fma-fmad.ll
llvm/test/CodeGen/AMDGPU/madak.ll