diff options
| author | Tim Northover <tnorthover@apple.com> | 2016-05-13 19:16:14 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2016-05-13 19:16:14 +0000 |
| commit | f8b0a7af52f8c4ec6b4ddcfe3a6fa75098c9507c (patch) | |
| tree | 2219a9d046854c8652752a7a5734652c31b13ebf /llvm/lib/Target/ARM/ARMCallingConv.td | |
| parent | 0f791f44c72bc5b52dfb31bcf6b6fe4f411d5fd2 (diff) | |
| download | bcm5719-llvm-f8b0a7af52f8c4ec6b4ddcfe3a6fa75098c9507c.tar.gz bcm5719-llvm-f8b0a7af52f8c4ec6b4ddcfe3a6fa75098c9507c.zip | |
ARM: use callee-saved list in the order they're actually saved.
When setting the frame pointer, the offset from SP is calculated based on the
stack slot it gets allocated, but this slot is in turn based on the order of
the CSR list so that list should match the order we actually save the registers
in. Mostly it did, but in the edge-case of MachO AAPCS targets it was wrong.
llvm-svn: 269459
Diffstat (limited to 'llvm/lib/Target/ARM/ARMCallingConv.td')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMCallingConv.td | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMCallingConv.td b/llvm/lib/Target/ARM/ARMCallingConv.td index c477208b111..edb69581b9d 100644 --- a/llvm/lib/Target/ARM/ARMCallingConv.td +++ b/llvm/lib/Target/ARM/ARMCallingConv.td @@ -246,6 +246,14 @@ def CSR_NoRegs : CalleeSavedRegs<(add)>; def CSR_AAPCS : CalleeSavedRegs<(add LR, R11, R10, R9, R8, R7, R6, R5, R4, (sequence "D%u", 15, 8))>; +// The order of callee-saved registers needs to match the order we actually push +// them in FrameLowering, because this order is what's used by +// PrologEpilogInserter to allocate frame index slots. So when R7 is the frame +// pointer, we use this AAPCS alternative. +def CSR_AAPCS_SplitPush : CalleeSavedRegs<(add LR, R7, R6, R5, R4, + R11, R10, R9, R8, + (sequence "D%u", 15, 8))>; + // Constructors and destructors return 'this' in the ARM C++ ABI; since 'this' // and the pointer return value are both passed in R0 in these cases, this can // be partially modelled by treating R0 as a callee-saved register |

