Revert "[AVR] Enable the frame pointer for all functions"
authorDylan McKay <me@dylanmckay.io>
Wed, 3 May 2017 11:36:42 +0000 (11:36 +0000)
committerDylan McKay <me@dylanmckay.io>
Wed, 3 May 2017 11:36:42 +0000 (11:36 +0000)
This reverts commit 358ad02d999e88853d2cfc954bd2f668308a51f7.

llvm-svn: 302014

llvm/lib/Target/AVR/AVRFrameLowering.cpp

index 25232d2..c297865 100644 (file)
@@ -228,9 +228,8 @@ void AVRFrameLowering::emitEpilogue(MachineFunction &MF,
 bool AVRFrameLowering::hasFP(const MachineFunction &MF) const {
   const AVRMachineFunctionInfo *FuncInfo = MF.getInfo<AVRMachineFunctionInfo>();
 
-  // 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(