[llvm] [PPC][AIX] Set needsFP to true when base pointer is used in prologue/… (PR #100182)

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 18:16:48 PDT 2024


================
@@ -376,6 +376,9 @@ bool PPCFrameLowering::needsFP(const MachineFunction &MF) const {
   if (MF.getFunction().hasFnAttribute(Attribute::Naked))
     return false;
 
+  if (Subtarget.isAIXABI() && Subtarget.getRegisterInfo()->hasBasePointer(MF))
+    return true;
----------------
chenzheng1030 wrote:

hmm, for this case, what we need is the backup/restore instructions for r31 because r30 is used, not the real frame pointer register, i.e. if we change the API here, we have redundant `mr 31, 1`. Can we just add the backup/restore instructions instead? For example, just change `emitPrologue()` and `emitEpilogue` for the store/load? (May also need to change the place where the stack object is allocated for the frame pointer register.)

https://github.com/llvm/llvm-project/pull/100182


More information about the llvm-commits mailing list