-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[ARM] Optimise non-ABI frame pointers #110286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
a75ebc8
51dc9bd
63763a7
bb8af0f
1431150
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -492,17 +492,16 @@ ARMSubtarget::getPushPopSplitVariation(const MachineFunction &MF) const { | |
| const std::vector<CalleeSavedInfo> CSI = | ||
| MF.getFrameInfo().getCalleeSavedInfo(); | ||
|
|
||
| // Returns SplitR7 if the frame setup must be split into two separate pushes | ||
| // of r0-r7,lr and another containing r8-r11 (+r12 if necessary). This is | ||
| // always required on Thumb1-only targets, as the push and pop instructions | ||
| // can't access the high registers. This is also required when R7 is the frame | ||
| // pointer and frame pointer elimiination is disabled, or branch signing is | ||
| // enabled and AAPCS is disabled. | ||
| if ((MF.getInfo<ARMFunctionInfo>()->shouldSignReturnAddress() && | ||
| !createAAPCSFrameChain()) || | ||
| (getFramePointerReg() == ARM::R7 && | ||
| MF.getTarget().Options.DisableFramePointerElim(MF)) || | ||
| isThumb1Only()) | ||
| // Thumb1 always splits the pushes at R7, because the Thumb1 push instruction | ||
| // cannot use high registers except for lr. | ||
| if (isThumb1Only()) | ||
| return SplitR7; | ||
|
|
||
| // If R7 is the frame pointer, we must split at R7 to ensure that the | ||
| // previous frame pointer (R7) and return address (LR) are adjacent on the | ||
| // stack, to form a valid frame record. | ||
| if (getFramePointerReg() == ARM::R7 && | ||
| MF.getTarget().Options.DisableFramePointerElim(MF)) | ||
|
||
| return SplitR7; | ||
|
|
||
| // Returns SplitR11WindowsSEH when the stack pointer needs to be | ||
|
|
@@ -515,11 +514,12 @@ ARMSubtarget::getPushPopSplitVariation(const MachineFunction &MF) const { | |
| (MFI.hasVarSizedObjects() || getRegisterInfo()->hasStackRealignment(MF))) | ||
| return SplitR11WindowsSEH; | ||
|
|
||
| // Returns R11SplitAAPCSBranchSigning if R11 and lr are not adjacent to each | ||
| // other in the list of callee saved registers in a frame, and branch | ||
| // signing is enabled. | ||
| // Returns SplitR11AAPCSSignRA when the frame pointer is R11, requiring R11 | ||
| // and LR to be adjacent on the stack, and branch signing is enabled, | ||
| // requiring R12 to be on the stack. | ||
| if (MF.getInfo<ARMFunctionInfo>()->shouldSignReturnAddress() && | ||
| getFramePointerReg() == ARM::R11) | ||
| getFramePointerReg() == ARM::R11 && | ||
| MF.getTarget().Options.DisableFramePointerElim(MF)) | ||
| return SplitR11AAPCSSignRA; | ||
| return NoSplit; | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this lambda requires any captures, so the
[=]can be replaced[].There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, also removed the capture from the one above.