[all-commits] [llvm/llvm-project] 2e78e9: AMDGPU: Teach isOperandLegal about SALU literal re...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Tue Feb 18 05:00:27 PST 2025


  Branch: refs/heads/users/arsenm/amdgpu/avoid-double-literal-salu-isOperandLegal
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e78e98636cff6a55208638159d820000c2656b5
      https://github.com/llvm/llvm-project/commit/2e78e98636cff6a55208638159d820000c2656b5
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-02-18 (Tue, 18 Feb 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
    M llvm/test/CodeGen/AMDGPU/fold-operands-scalar-fmac.mir
    M llvm/test/CodeGen/AMDGPU/fold-sgpr-multi-imm.mir

  Log Message:
  -----------
  AMDGPU: Teach isOperandLegal about SALU literal restrictions

isOperandLegal mostly implemented the VALU operand rules, and
largely ignored SALU restrictions. This theoretically avoids
folding literals into SALU insts which already have a literal
operand. This issue is currently avoided due to a bug in
SIFoldOperands; this change will allow using raw operand
legality rules.

This breaks the formation of s_fmaak_f32 in SIFoldOperands,
but it probably should not have been forming there in the first
place. TwoAddressInsts or RA should generally handle that,
and this only worked by accident.



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