[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
Thu May 11 14:09:31 PDT 2023


Everybody0523 added inline comments.


================
Comment at: llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp:1354
+          .addReg(SystemZ::R3D)
+          .addReg(SystemZ::R0D)
+          .addImm(SaveSlotR3)
----------------
uweigand wrote:
> %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.
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.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150332/new/

https://reviews.llvm.org/D150332



More information about the llvm-commits mailing list