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

Matt Arsenault via All-commits all-commits at lists.llvm.org
Wed Feb 26 17:36:10 PST 2025


  Branch: refs/heads/users/arsenm/do-not-commute-instruction-with-same-reg
  Home:   https://github.com/llvm/llvm-project
  Commit: 0edaa874fbe815a0d3a9f304aeadc8632c56b0f1
      https://github.com/llvm/llvm-project/commit/0edaa874fbe815a0d3a9f304aeadc8632c56b0f1
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-02-27 (Thu, 27 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
    M 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