[all-commits] [llvm/llvm-project] 66ae28: [AMDGPU] Use s_fmamk_f32 when the folded addend is...

Barbara Mitic via All-commits all-commits at lists.llvm.org
Thu Sep 17 03:50:16 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 66ae28fd8f686b6b558796f70ca388523158a20c
      https://github.com/llvm/llvm-project/commit/66ae28fd8f686b6b558796f70ca388523158a20c
  Author: Barbara Mitic <Barbara.Mitic at amd.com>
  Date:   2026-09-17 (Thu, 17 Sep 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
    M llvm/test/CodeGen/AMDGPU/fold-operands-scalar-fmac.mir

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list