[PATCH] D81364: AMDGPU Initializes StackPtrOffset when NonSpillStackObjects present

David Stuttard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 02:08:13 PDT 2020


dstuttard created this revision.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, t-tye, tpr, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.
dstuttard added reviewers: scott.linder, arsenm.
dstuttard marked an inline comment as done.
dstuttard added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:463
+  // initialize SP in case it is required.
+  if (MF.getFrameInfo().hasCalls() || MFI->hasNonSpillStackObjects()) {
     Register SPReg = MFI->getStackPtrOffsetReg();
----------------
Is there a way to finesse this so it's only added when it is likely to be required?



If the function has NonSpillStackObjects it may be the case that the SP is
required (although not often). Updated the SP Reg init code to do the
initialization in this extra case.

Change-Id: Ib37174109082086ac2309d431179ee51f9e1bc9a


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81364

Files:
  llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/dynamic-alloca-uniform.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/non-entry-alloca.ll
  llvm/test/CodeGen/AMDGPU/cc-update.ll
  llvm/test/CodeGen/AMDGPU/chain-hi-to-lo.ll
  llvm/test/CodeGen/AMDGPU/idot8s.ll
  llvm/test/CodeGen/AMDGPU/idot8u.ll
  llvm/test/CodeGen/AMDGPU/non-entry-alloca.ll
  llvm/test/CodeGen/AMDGPU/stack-realign-kernel.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81364.269122.patch
Type: text/x-patch
Size: 41195 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200608/b582bf2a/attachment.bin>


More information about the llvm-commits mailing list