[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
Mon Sep 23 06:28:43 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff f5a65d8752f26245744ae3e1365cc3ac283c2638 45efaeee56f8eb739296b7b7a1804a236ca827c9 --extensions h,cpp -- llvm/include/llvm/Target/TargetOptions.h llvm/lib/CodeGen/TargetOptionsImpl.cpp llvm/lib/Target/ARM/ARMFrameLowering.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Target/TargetOptions.h b/llvm/include/llvm/Target/TargetOptions.h
index bd6be65239..5ae5badff3 100644
--- a/llvm/include/llvm/Target/TargetOptions.h
+++ b/llvm/include/llvm/Target/TargetOptions.h
@@ -161,9 +161,10 @@ namespace llvm {
/// DisableFramePointerElim - This returns true if frame pointer elimination
/// optimization should be disabled for the given machine function.
bool DisableFramePointerElim(const MachineFunction &MF) const;
-
- /// DisableLeafFramePointerElim - This returns true if leaf frame pointer elimination
- /// optimization should be disabled for the given machine function.
+
+ /// DisableLeafFramePointerElim - This returns true if leaf frame pointer
+ /// elimination optimization should be disabled for the given machine
+ /// function.
bool DisableLeafFramePointerElim(const MachineFunction &MF) const;
/// FramePointerIsReserved - This returns true if the frame pointer must
diff --git a/llvm/lib/CodeGen/TargetOptionsImpl.cpp b/llvm/lib/CodeGen/TargetOptionsImpl.cpp
index a5248ab5a9..dda9118c87 100644
--- a/llvm/lib/CodeGen/TargetOptionsImpl.cpp
+++ b/llvm/lib/CodeGen/TargetOptionsImpl.cpp
@@ -40,9 +40,10 @@ 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(const MachineFunction &MF) const {
+/// DisableLeafFramePointerElim - This returns true if leaf frame pointer
+/// elimination optimization should be disabled for the given machine function.
+bool TargetOptions::DisableLeafFramePointerElim(
+ const MachineFunction &MF) const {
const Function &F = MF.getFunction();
if (!F.hasFnAttribute("frame-pointer"))
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 73c0257eea..b34c289fe7 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -2271,7 +2271,8 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
// is spilled in the order specified by getCalleeSavedRegs() to make it easier
// to combine multiple loads / stores.
bool CanEliminateFrame = !(requiresAAPCSFrameRecord(MF) && hasFP(MF));
- bool CanEliminateLeafFrame = !MF.getTarget().Options.DisableLeafFramePointerElim(MF);
+ bool CanEliminateLeafFrame =
+ !MF.getTarget().Options.DisableLeafFramePointerElim(MF);
bool CS1Spilled = false;
bool LRSpilled = false;
unsigned NumGPRSpills = 0;
@@ -2513,8 +2514,8 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
<< "; EstimatedStack: " << EstimatedStackSize
<< "; EstimatedFPStack: " << MaxFixedOffset - MaxFPOffset
<< "; BigFrameOffsets: " << BigFrameOffsets << "\n");
- if (BigFrameOffsets ||
- !CanEliminateFrame || RegInfo->cannotEliminateFrame(MF) || !CanEliminateLeafFrame) {
+ if (BigFrameOffsets || !CanEliminateFrame ||
+ RegInfo->cannotEliminateFrame(MF) || !CanEliminateLeafFrame) {
AFI->setHasStackFrame(true);
if (HasFP) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/109628
More information about the llvm-commits
mailing list