[PATCH] D140708: [AMDGPU][GFX908] Only consider explicit defs of src reg in indirect agpr copy

Jeffrey Byrnes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 27 15:08:12 PST 2022


jrbyrnes created this revision.
jrbyrnes added reviewers: arsenm, rampitec.
Herald added subscribers: kosarev, foad, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
jrbyrnes requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

When doing indirect copy to AGPR, we parse all previous instructions in attempt to find an accvgpr_write which has a dest that holds the src of the copy -- we can use this instead of reconstructing a accvgpr_write. However, after https://github.com/llvm/llvm-project/commit/663f16684d1a5f129874b7be9e1f486682977bfa we add implicit defs of the wide AGPR to AGPR spills. Thus, we previously determine flag accvgpr_writes as holding the src of the copy, when, in fact, they hold some other subreg of the src. Ideally, we would not need to attach implicit_defs for each agpr spill. This patch resolves the bug until we have a better way of doing things. It modifies indirectCopyToAGPR s.t. it only considers accvgpr_writes that explicitly define the vgpr.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140708

Files:
  llvm/include/llvm/CodeGen/MachineInstr.h
  llvm/lib/CodeGen/MachineInstr.cpp
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
  llvm/test/CodeGen/AMDGPU/accvgpr-copy-implicit-def.mir
  llvm/test/CodeGen/AMDGPU/accvgpr-copy.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140708.485427.patch
Type: text/x-patch
Size: 9198 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221227/670a2de5/attachment.bin>


More information about the llvm-commits mailing list