[PATCH] D134423: [AMDGPU] Fix vgpr2sgpr copy to scalar operands of buffer instructions.

krishna chaitanya sankisa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 22 03:43:15 PDT 2022


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

In si-fix-sgpr-copies pass, lowering of COPY instruction (vgpr to sgpr) to VALU or to v_readfirstlane_b32 is done. It is decided based on the SALU instructions users of result of COPY. It misses the case where the use of result of COPY need to be scalar register only. Example: In buffer instructions, there are scalar operands (sOffset) which will only accept scalar registers.

This change lowers the vgpr2sgpr copies to use v_readfirstlane_b32, if the result of copy is used by operands of buffer instructions which needs to be scalar registers.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134423

Files:
  llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp
  llvm/test/CodeGen/AMDGPU/mubuf-legalize-operands.ll
  llvm/test/CodeGen/AMDGPU/si-fix-sgpr-copies-buf.ll
  llvm/test/CodeGen/AMDGPU/vgpr-descriptor-waterfall-loop-idom-update.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134423.462123.patch
Type: text/x-patch
Size: 40332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220922/a11095b0/attachment.bin>


More information about the llvm-commits mailing list