mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
[ARM] Back up R4 and LR if calling the stack probe function
Differential Revision: https://reviews.llvm.org/D46777 llvm-svn: 332298
This commit is contained in:
parent
0b36643562
commit
0ceabcff5d
@ -1620,6 +1620,17 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
|
|||||||
(MFI.hasVarSizedObjects() || RegInfo->needsStackRealignment(MF)))
|
(MFI.hasVarSizedObjects() || RegInfo->needsStackRealignment(MF)))
|
||||||
SavedRegs.set(ARM::R4);
|
SavedRegs.set(ARM::R4);
|
||||||
|
|
||||||
|
// If a stack probe will be emitted, spill R4 and LR, since they are
|
||||||
|
// clobbered by the stack probe call.
|
||||||
|
// This estimate should be a safe, conservative estimate. The actual
|
||||||
|
// stack probe is enabled based on the size of the local objects;
|
||||||
|
// this estimate also includes the varargs store size.
|
||||||
|
if (STI.isTargetWindows() &&
|
||||||
|
WindowsRequiresStackProbe(MF, MFI.estimateStackSize(MF))) {
|
||||||
|
SavedRegs.set(ARM::R4);
|
||||||
|
SavedRegs.set(ARM::LR);
|
||||||
|
}
|
||||||
|
|
||||||
if (AFI->isThumb1OnlyFunction()) {
|
if (AFI->isThumb1OnlyFunction()) {
|
||||||
// Spill LR if Thumb1 function uses variable length argument lists.
|
// Spill LR if Thumb1 function uses variable length argument lists.
|
||||||
if (AFI->getArgRegsSaveSize() > 0)
|
if (AFI->getArgRegsSaveSize() > 0)
|
||||||
|
@ -18,7 +18,7 @@ entry:
|
|||||||
}
|
}
|
||||||
|
|
||||||
; CHECK-LABEL: isel
|
; CHECK-LABEL: isel
|
||||||
; CHECK: push {r4, r5}
|
; CHECK: push {r4, r5, r6, lr}
|
||||||
; CHECK: movw r12, #0
|
; CHECK: movw r12, #0
|
||||||
; CHECK: movt r12, #0
|
; CHECK: movt r12, #0
|
||||||
; CHECK: movw r4, #{{\d*}}
|
; CHECK: movw r4, #{{\d*}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user