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.
Details
Diff Detail
Event Timeline
llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp | ||
---|---|---|
1354 | %r0 cannot be used as base register. Is this really supposed to store to the low core? (On Linux, that might be unsafe as it could be clobbered if we're e.g. interrupted by an async signal handler - not sure if there are similar concerns on z/OS.) If yes, you need to use addReg(0) here. If no, I guess some other changes are required. |
llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp | ||
---|---|---|
1354 | Right, this was indeed a mistake. I've amended it to use the incoming value of r4 (ie. r4 before the stack update) for the store, and then to use r3 as the base register (after a load from r0 to r3) in the load. |
%r0 cannot be used as base register. Is this really supposed to store to the low core? (On Linux, that might be unsafe as it could be clobbered if we're e.g. interrupted by an async signal handler - not sure if there are similar concerns on z/OS.) If yes, you need to use addReg(0) here. If no, I guess some other changes are required.