[PATCH] D105062: [AMDGPU] Reduce AGPR to AGPR copies with same source

Vang Thao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 13:57:17 PDT 2021


vangthao created this revision.
Herald added subscribers: foad, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
vangthao requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

On targets where direct AGPR to AGPR copy is not possible, the postrapseudos
pass tries to expand AGPR to AGPR copies by first trying to find the defining
accvgpr_write instruction and propagating its vgpr register to avoid creating
temporary registers. In cases where we cannot propagate, a new temporary VGPR
register will be created for each AGPR copy instruction even if the sources
are the same for all or some of the copy instructions.

With this patch, after failing to propagate the defining instruction's VGPR
register, we will next try to see if another copy instruction has already
inserted in a temporay VGPR copy with accvgpr_read and attempt to propagate
that copy.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105062

Files:
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
  llvm/test/CodeGen/AMDGPU/accvgpr-copy.mir
  llvm/test/CodeGen/AMDGPU/llvm.amdgcn.mfma.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105062.355029.patch
Type: text/x-patch
Size: 117503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210628/3a3a60d6/attachment-0001.bin>


More information about the llvm-commits mailing list