[llvm] [SystemZ][z/OS] Reverse the order of instructions to save and restore CSRs (PR #179540)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 4 05:33:17 PST 2026
sujianIBM wrote:
> It seems odd to define them in inverted order and then invert them again for output. Is there a reason for that?
When the sequence is processed in `assignCalleeSavedSpillSlots()`, the FrameIdx of each register is decided. The register processed first gets the smallest idx, which leads to the highest address on stack (XPLINK). So at this point we want `F15` to be processed first and put on the highest address.
In the following `spillCalleeSavedRegisters()` and `restoreCalleeSavedRegisters()`, we want the instruction on `F15` to be the last.
https://github.com/llvm/llvm-project/pull/179540
More information about the llvm-commits
mailing list