[SystemZ] [z/OS] Use assignCalleeSavedSpillSlots() to mark handle special registers...
authorNeumann Hon <h.neukc@gmail.com>
Thu, 7 Jul 2022 02:22:25 +0000 (22:22 -0400)
committerNeumann Hon <h.neukc@gmail.com>
Thu, 7 Jul 2022 02:22:25 +0000 (22:22 -0400)
commitc45ec53e7b852c1d874b6ffac11ce71ca21415dd
tree5820a2479383914f2cada15ed5ad7c03f4b3a221
parent362240e09e9e203b65d14b0b620803e7caa26536
[SystemZ] [z/OS] Use assignCalleeSavedSpillSlots() to mark handle special registers in CSR list instead of determineCalleeSave

This PR moves the handling of special registers that need to be saved/restored in the prolog/epilog respectively from determineCalleeSaves to assignCalleeSavedSpillSlots. The documentation of the parent function of assignCalleeSavedSpillSlots explicitly allows the modification of the CSI hence adding the special registers (the stack pointer register, the return address register, and the entry point register) to the CSI list at that stage should be permissible.

This cleans up the code a bit and makes it so that we do not have to place registers that are not actually considered CSRs by the spec in the CSR list, which is something of a hack.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D125044
llvm/lib/Target/SystemZ/SystemZCallingConv.td
llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp