[PATCH] D136169: [AMDGPU] Avoid SCC clobbering before S_CSELECT_B32

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 06:40:56 PDT 2022


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

Frame lowering inserts scalar addition to compute the offset to the
stack objects.  This instructions inserted in arbitrary place and may clobber
SCC between its definition and S_CSELECT_B32 instruction.  This change
workarounds this particular code pattern. It queries the scavenger for SGPR and
if available saves SCC to it and restore its value after frame lowering code
insertion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136169

Files:
  llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
  llvm/test/CodeGen/AMDGPU/frame-index.mir
  llvm/test/CodeGen/AMDGPU/pei-scavenge-sgpr-carry-out.mir
  llvm/test/CodeGen/AMDGPU/pei-scavenge-sgpr-gfx9.mir
  llvm/test/CodeGen/AMDGPU/pei-scavenge-sgpr.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136169.468522.patch
Type: text/x-patch
Size: 17515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221018/dde7c588/attachment.bin>


More information about the llvm-commits mailing list