llvm-project
66ae28fd - [AMDGPU] Use s_fmamk_f32 when the folded addend is inlinable (#218955)

Commit
34 days ago
[AMDGPU] Use s_fmamk_f32 when the folded addend is inlinable (#218955) When folding a constant into src2 of s_fmac_f32, the AK form (s_fmaak_f32) was always selected, which puts the folded addend in the literal slot. If that addend is an inline constant while one of the multiplicands is not, this wastes the literal slot and still requires an extra s_mov_b32 for the multiplicand. Choose the instruction variant based on which operand actually needs the literal instead. If the folded addend is inlinable and a multiplicand is not, use the MK form (s_fmamk_f32), placing the non-inlinable multiplicand in the literal slot and encoding the addend inline.
Author
Parents
Loading