[llvm] [ARM] Fix -mno-omit-leaf-frame-pointer flag doesn't works on 32-bit ARM (PR #109628)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 06:38:19 PDT 2024
================
@@ -40,6 +40,20 @@ bool TargetOptions::DisableFramePointerElim(const MachineFunction &MF) const {
llvm_unreachable("unknown frame pointer flag");
}
+/// DisableLeafFramePointerElim - This returns true if leaf frame pointer
+/// elimination optimization should be disabled for the given machine function.
+bool TargetOptions::DisableLeafFramePointerElim(
----------------
guoxin049 wrote:
I did an experiment and changed it like this `bool CanEliminateFrame = !(requiresAAPCSFrameRecord(MF) && hasFP(MF)) && !MF.getTarget().Options.DisableFramePointerElim(MF);`
However, fp is retained in the following scenarios:
https://github.com/llvm/llvm-project/blob/3f37c517fbc40531571f8b9f951a8610b4789cd6/llvm/lib/Target/ARM/ARMFrameLowering.cpp#L180-L185
I don't know if it makes sense. For example, the fast-isel-intrinsic.ll test case saves fp.
https://github.com/llvm/llvm-project/pull/109628
More information about the llvm-commits
mailing list