[all-commits] [llvm/llvm-project] 1d3dce: AMDGPU: Do not try to commute instruction with sam...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Tue Feb 18 02:21:50 PST 2025


  Branch: refs/heads/users/arsenm/do-not-commute-instruction-with-same-reg
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d3dce0a7e4771f8718981aa490597d8b821a606
      https://github.com/llvm/llvm-project/commit/1d3dce0a7e4771f8718981aa490597d8b821a606
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-02-18 (Tue, 18 Feb 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
    M llvm/test/CodeGen/AMDGPU/dag-divergence.ll
    M llvm/test/CodeGen/AMDGPU/div_i128.ll
    M llvm/test/CodeGen/AMDGPU/div_v2i128.ll
    M llvm/test/CodeGen/AMDGPU/rem_i128.ll
    A llvm/test/CodeGen/AMDGPU/si-fold-operands-commute-same-operands-assert.mir

  Log Message:
  -----------
  AMDGPU: Do not try to commute instruction with same input register

There's little point to trying to commute an instruction if the
two operands are already the same.

This avoids an assertion in a future patch, but this likely isn't the
correct fix. The worklist management in SIFoldOperands is dodgy, and
we should probably fix it to work like PeepholeOpt (i.e. stop looking
at use lists, and fold from users). This is an extension of the already
handled special case which it's trying to avoid folding an instruction
which is already being folded.



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