[llvm] [ARM] R11 not pushed adjacent to link register with PAC-M and AAPCS frame chain fix (PR #82801)
James Westwood via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 28 05:55:12 PST 2024
================
@@ -441,18 +441,28 @@ class ARMSubtarget : public ARMGenSubtargetInfo {
}
/// Returns true if the frame setup is split into two separate pushes (first
- /// r0-r7,lr then r8-r11), principally so that the frame pointer is adjacent
- /// to lr. This is always required on Thumb1-only targets, as the push and
- /// pop instructions can't access the high registers.
- bool splitFramePushPop(const MachineFunction &MF) const {
- if (MF.getInfo<ARMFunctionInfo>()->shouldSignReturnAddress())
+ /// r0-r7,lr then r8-r11), principally so that the frame pointer r7 is
+ /// adjacent to lr. This is always required on Thumb1-only targets, as the
+ /// push and pop instructions can't access the high registers.
+ bool splitFramePushPopR7(const MachineFunction &MF) const {
+ if (MF.getInfo<ARMFunctionInfo>()->shouldSignReturnAddress() &&
+ !createAAPCSFrameChain())
return true;
return (getFramePointerReg() == ARM::R7 &&
MF.getTarget().Options.DisableFramePointerElim(MF)) ||
isThumb1Only();
}
- bool splitFramePointerPush(const MachineFunction &MF) const;
+ bool framePointerRequiredForSEHUnwind(const MachineFunction &MF) const;
+
+ // Returns true if R11 and lr are not adjacent to each other in the list of
+ // callee saved registers in a frame.
+ bool r11AndLRNotAdjacent(const MachineFunction &MF) const;
+
+ // Returns true if the frame setup is split into two separate pushes (first
+ // r0-r10,r12 then r11,lr), principally so that the frame pointer r11 is
+ // adjacent to lr.
+ bool splitFramePushPopR11(const MachineFunction &MF) const;
----------------
jwestwood921 wrote:
I agree that using an enum is a better option. I think having a separate enum value for each push variation may be overkill, as many push variations are implemented in the same way by the frame lowering files. For example, the normal push and branch signing unsplit push are handled the same way, there is just an extra register in the latter variation. It might therefore be a better option to have an enum with values based around which register, if any, causes the register push to be split, instead of a value for each specific push variation.
https://github.com/llvm/llvm-project/pull/82801
More information about the llvm-commits
mailing list