[llvm] [PPC][AIX] Set needsFP to true when base pointer is used in prologue/… (PR #100182)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 29 13:35:17 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 e3b30bc553775f29661eebc8e022efa4cad91610 069da92030f3137fe108af3c4eaf7c6ab584e980 --extensions cpp -- llvm/lib/Target/PowerPC/PPCFrameLowering.cpp llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
index 9dfeefc403..630e21796f 100644
--- a/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
@@ -376,7 +376,6 @@ bool PPCFrameLowering::needsFP(const MachineFunction &MF) const {
if (MF.getFunction().hasFnAttribute(Attribute::Naked))
return false;
-
return MF.getTarget().Options.DisableFramePointerElim(MF) ||
MFI.hasVarSizedObjects() || MFI.hasStackMap() || MFI.hasPatchPoint() ||
MF.exposesReturnsTwice() ||
@@ -1008,7 +1007,7 @@ void PPCFrameLowering::emitPrologue(MachineFunction &MF,
// R0 cannot be used as a base register, but it can be used as an
// index in a store-indexed.
int LastOffset = 0;
- if (HasFP || (HasBP && Subtarget.isAIXABI())) {
+ if (HasFP || (HasBP && Subtarget.isAIXABI())) {
// R0 += (FPOffset-LastOffset).
// Need addic, since addi treats R0 as 0.
BuildMI(MBB, MBBI, dl, TII.get(PPC::ADDIC), ScratchReg)
@@ -1995,8 +1994,8 @@ void PPCFrameLowering::determineCalleeSaves(MachineFunction &MF,
MachineFrameInfo &MFI = MF.getFrameInfo();
// If the frame pointer save index hasn't been defined yet.
- if (!FPSI && (needsFP(MF)
- || (RegInfo->hasBasePointer(MF) && Subtarget.isAIXABI()))) {
+ if (!FPSI &&
+ (needsFP(MF) || (RegInfo->hasBasePointer(MF) && Subtarget.isAIXABI()))) {
// Find out what the fix offset of the frame pointer save area.
int FPOffset = getFramePointerSaveOffset();
// Allocate the frame index for frame pointer save area.
``````````
</details>
https://github.com/llvm/llvm-project/pull/100182
More information about the llvm-commits
mailing list