[SystemZ][z/OS] Save (and restore) R3 to avoid clobbering parameter when call stack...
authorNeumann Hon <neumann.hon@ibm.com>
Fri, 12 May 2023 01:25:05 +0000 (21:25 -0400)
committerNeumann Hon <neumann.hon@ibm.com>
Fri, 12 May 2023 01:25:05 +0000 (21:25 -0400)
commit1aec3d15aaa25c39fae026688708d7353d488974
tree801d2499c2243088c5227314fdd828742c0495b5
parentc2f0c204d1847fac9f8d47c06a40cecd717a546d
[SystemZ][z/OS] Save (and restore) R3 to avoid clobbering parameter when call stack frame extension is invoked

When the stack frame extension routine is used, the contents of r3 is
overwritten. However, if r3 is live in the prologue (ie. one of the
function's parameters resides in r3), it needs to be saved. We save
r3 in r0 if r0 is available (ie. r0 is not used as temporary storage
for r4), and in the corresponding stack slot for the third parameter otherwise.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D150332
llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
llvm/test/CodeGen/SystemZ/zos-prologue-epilog.ll