[all-commits] [llvm/llvm-project] 088e57: AMDGPU: Fix DPP combiner using isOperandLegal on i...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Wed Aug 27 04:20:28 PDT 2025


  Branch: refs/heads/users/arsenm/amdgpu/dpp-avoid-isOperandLegal-incomplete-instruction
  Home:   https://github.com/llvm/llvm-project
  Commit: 088e57a3b0ec8c76c3a44f717048f1dcf8843004
      https://github.com/llvm/llvm-project/commit/088e57a3b0ec8c76c3a44f717048f1dcf8843004
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-08-27 (Wed, 27 Aug 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp
    M llvm/test/CodeGen/AMDGPU/dpp_combine_gfx11.mir

  Log Message:
  -----------
  AMDGPU: Fix DPP combiner using isOperandLegal on incomplete inst

It is not safe to use isOperandLegal on an instruction that does
not have a complete set of operands. Unforunately the APIs are
not set up in a convenient way to speculatively check if an instruction
will be legal in a hypothetical instruction. Build all the operands
and then verify they are legal after. This is clumsy, we should have
a more direct check for will these operands give a legal instruction.

This seems to fix a missed optimization in the gfx11 test. The
fold was firing for gfx1150, but not gfx1100. Both should support
vop3 literals so I'm not sure why it wasn't working before.



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