Don't want to add FramePtr to callee save spill list twice.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 31 Jan 2007 23:17:29 +0000 (23:17 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 31 Jan 2007 23:17:29 +0000 (23:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33727 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMRegisterInfo.cpp

index 4d48a7a078049a206d9b208d2eafc9a67f6afc2b..d76aedb0afde055a58717ae31d4d1be9c081b021 100644 (file)
@@ -881,13 +881,7 @@ processFunctionBeforeCalleeSavedScan(MachineFunction &MF) const {
     }
   }
 
-  if (hasFP(MF)) {
-    MF.changePhyRegUsed(FramePtr, true);
-    NumGPRSpills++;
-    CanEliminateFrame = false;
-  }
-
-  if (!CanEliminateFrame) {
+  if (!CanEliminateFrame || hasFP(MF)) {
     AFI->setHasStackFrame(true);
 
     // If LR is not spilled, but at least one of R4, R5, R6, and R7 is spilled.
@@ -902,7 +896,7 @@ processFunctionBeforeCalleeSavedScan(MachineFunction &MF) const {
 
     // Darwin ABI requires FP to point to the stack slot that contains the
     // previous FP.
-    if (STI.isTargetDarwin()) {
+    if (STI.isTargetDarwin() || hasFP(MF)) {
       MF.changePhyRegUsed(FramePtr, true);
       NumGPRSpills++;
     }