@@ -1479,7 +1479,6 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
14791479 bool CS1Spilled = false ;
14801480 bool LRSpilled = false ;
14811481 unsigned NumGPRSpills = 0 ;
1482- unsigned NumFPRSpills = 0 ;
14831482 SmallVector<unsigned , 4 > UnspilledCS1GPRs;
14841483 SmallVector<unsigned , 4 > UnspilledCS2GPRs;
14851484 const ARMBaseRegisterInfo *RegInfo = static_cast <const ARMBaseRegisterInfo *>(
@@ -1534,17 +1533,8 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
15341533 CanEliminateFrame = false ;
15351534 }
15361535
1537- if (!ARM::GPRRegClass.contains (Reg)) {
1538- if (Spilled) {
1539- if (ARM::SPRRegClass.contains (Reg))
1540- NumFPRSpills++;
1541- else if (ARM::DPRRegClass.contains (Reg))
1542- NumFPRSpills += 2 ;
1543- else if (ARM::QPRRegClass.contains (Reg))
1544- NumFPRSpills += 4 ;
1545- }
1536+ if (!ARM::GPRRegClass.contains (Reg))
15461537 continue ;
1547- }
15481538
15491539 if (Spilled) {
15501540 NumGPRSpills++;
@@ -1617,14 +1607,11 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF,
16171607 // FIXME: We could add logic to be more precise about negative offsets
16181608 // and which instructions will need a scratch register for them. Is it
16191609 // worth the effort and added fragility?
1620- auto ArgStackSize = MF.getInfo <ARMFunctionInfo>()->getArgumentStackSize ();
1621- bool BigStack =
1622- (RS && (MFI->estimateStackSize (MF) + 4 * (NumGPRSpills + NumFPRSpills) +
1623- (!hasFP (MF) ? ArgStackSize : 0 ) + 16 /* possible paddings */ +
1624- ((hasFP (MF) && AFI->hasStackFrame ()) ? 4 : 0 ) >=
1625- estimateRSStackSizeLimit (MF, this ))) ||
1626- MFI->hasVarSizedObjects () ||
1627- (MFI->adjustsStack () && !canSimplifyCallFramePseudos (MF));
1610+ bool BigStack = (RS && (MFI->estimateStackSize (MF) +
1611+ ((hasFP (MF) && AFI->hasStackFrame ()) ? 4 : 0 ) >=
1612+ estimateRSStackSizeLimit (MF, this ))) ||
1613+ MFI->hasVarSizedObjects () ||
1614+ (MFI->adjustsStack () && !canSimplifyCallFramePseudos (MF));
16281615
16291616 bool ExtraCSSpill = false ;
16301617 if (BigStack || !CanEliminateFrame || RegInfo->cannotEliminateFrame (MF)) {
0 commit comments