From 8ec2e3efa482c8bfc531d3ada159fae5c749f14a Mon Sep 17 00:00:00 2001 From: Dylan McKay Date: Wed, 3 May 2017 11:36:42 +0000 Subject: [PATCH] Revert "[AVR] Enable the frame pointer for all functions" This reverts commit 358ad02d999e88853d2cfc954bd2f668308a51f7. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302014 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AVR/AVRFrameLowering.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Target/AVR/AVRFrameLowering.cpp b/lib/Target/AVR/AVRFrameLowering.cpp index 25232d2e47e..c297865db82 100644 --- a/lib/Target/AVR/AVRFrameLowering.cpp +++ b/lib/Target/AVR/AVRFrameLowering.cpp @@ -228,9 +228,8 @@ void AVRFrameLowering::emitEpilogue(MachineFunction &MF, bool AVRFrameLowering::hasFP(const MachineFunction &MF) const { const AVRMachineFunctionInfo *FuncInfo = MF.getInfo(); - // TODO: We do not always need a frame pointer. - // This can be optimised. - return true; + return (FuncInfo->getHasSpills() || FuncInfo->getHasAllocas() || + FuncInfo->getHasStackArgs()); } bool AVRFrameLowering::spillCalleeSavedRegisters( -- 2.50.1