[all-commits] [llvm/llvm-project] b3d505: AMDGPU: Try to perform copy to agpr from reg_seque...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Mar 3 23:42:18 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b3d5056c79b5496fc8751630ddd0ac0071cab0af
      https://github.com/llvm/llvm-project/commit/b3d5056c79b5496fc8751630ddd0ac0071cab0af
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-03-04 (Tue, 04 Mar 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
    M llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.mfma.gfx90a.ll
    M llvm/test/CodeGen/AMDGPU/acc-ldst.ll
    A llvm/test/CodeGen/AMDGPU/coalesces-better.mir
    A llvm/test/CodeGen/AMDGPU/coalesces-worse.mir
    M llvm/test/CodeGen/AMDGPU/fold-agpr-phis.mir
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.mfma.scale.f32.16x16x128.f8f6f4.ll
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.mfma.scale.f32.32x32x64.f8f6f4.ll
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.smfmac.gfx950.ll
    M llvm/test/CodeGen/AMDGPU/mfma-no-register-aliasing.ll
    M llvm/test/CodeGen/AMDGPU/no-fold-accvgpr-mov.ll
    M llvm/test/CodeGen/AMDGPU/no-fold-accvgpr-mov.mir
    M llvm/test/CodeGen/AMDGPU/remaining-virtual-register-operands.ll
    M llvm/test/CodeGen/AMDGPU/schedule-xdl-resource.ll
    M llvm/test/CodeGen/AMDGPU/si-fold-operands-agpr-copy-reg-sequence.mir

  Log Message:
  -----------
  AMDGPU: Try to perform copy to agpr from reg_sequence at the copy (#129463)

SIFoldOperands is frustratingly written in a def-folds-into-use
iteration pattern, with a few random cases starting at the uses.
We were handling this case by looking at the reg_sequence, and finding
the copy. This did not work for the most basic pattern of materializing
a vector constant that started in SGPRs. It just happens there is an
optimization bug in SelectionDAG that produced the expected pattern.

Perform an additional attempt at the fold rooted at the copy. This
mostly shows test improvements. There were some tricky updates to
perform. remaining-virtual-register-operands.ll managed to stop failing
the allocator, so needed to be tricked into failing again. I also do
not understand what schedule-xdl-resource.ll is trying to do for the test
so this changes it to some random output that exists in the debug output.



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