[all-commits] [llvm/llvm-project] 70e1a3: [AMDGPU] Check legality of both operands before sw...

Paul Trojahn via All-commits all-commits at lists.llvm.org
Tue Jul 15 12:55:47 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 70e1a3ceada92c200e575e4fdcc1f27022b3c8f2
      https://github.com/llvm/llvm-project/commit/70e1a3ceada92c200e575e4fdcc1f27022b3c8f2
  Author: Paul Trojahn <paul.trojahn at gmail.com>
  Date:   2025-07-15 (Tue, 15 Jul 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
    A llvm/test/CodeGen/AMDGPU/fold-commute-sgpr.mir

  Log Message:
  -----------
  [AMDGPU] Check legality of both operands before swap (#148843)

When trying to fold an SGPR into the second operand to a DPP add,
si-fold-operands correctly determines that this is not possible and
attempts to swap the second and third operand. This succeeds even if the
third operand is an SGPR, creating an illegal dpp add with two SGPR
operands. We need to check both operands if they are legal in their new
position.

This causes a crash at compile time for a test in triton on gfx12:

https://github.com/triton-lang/triton/blob/345c633787e90a7f94864de3035346eb5de1781f/python/test/unit/language/test_core.py#L2718

Co-authored-by: Paul Trojahn <paul.trojahn at amd.com>



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