[PATCH] D150332: [SystemZ][z/OS] Save (and restore) R3 to avoid clobbering parameter when call stack frame extension is invoked

Neumann Hon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 17:09:16 PDT 2023


Everybody0523 created this revision.
Everybody0523 added reviewers: Kai, uweigand, yusra.syeda.
Herald added a subscriber: hiraditya.
Herald added a project: All.
Everybody0523 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When the stack frame extension routine is used, the contents of R3 <https://reviews.llvm.org/source/clang/> is overwritten. However, if R3 <https://reviews.llvm.org/source/clang/> is live in the prologue (ie. one of the function's parameters resides in R3 <https://reviews.llvm.org/source/clang/>), it needs to be saved. We save R3 <https://reviews.llvm.org/source/clang/> in R0 if R0 is available (ie. R0 is not used as temporary storage for R4 <https://reviews.llvm.org/source/lld/>), and in the corresponding stack slot for the third parameter otherwise.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150332

Files:
  llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
  llvm/test/CodeGen/SystemZ/zos-prologue-epilog.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150332.521166.patch
Type: text/x-patch
Size: 4324 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230511/506e3643/attachment-0001.bin>


More information about the llvm-commits mailing list