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

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Mar 3 01:24:47 PST 2025


  Branch: refs/heads/users/arsenm/amdgpu/fold-agpr-reg-sequence-at-copy-not-reg-sequence-user
  Home:   https://github.com/llvm/llvm-project
  Commit: a5de66e92352343925d5bf3d2a6ddb58e3b06632
      https://github.com/llvm/llvm-project/commit/a5de66e92352343925d5bf3d2a6ddb58e3b06632
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-03-03 (Mon, 03 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

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