File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -433,6 +433,10 @@ void X86RegisterInfo::adjustStackMapLiveOutMask(uint32_t *Mask) const {
433433// Stack Frame Processing methods
434434// ===----------------------------------------------------------------------===//
435435
436+ static bool CantUseSP (const MachineFrameInfo *MFI) {
437+ return MFI->hasVarSizedObjects () || MFI->hasOpaqueSPAdjustment ();
438+ }
439+
436440bool X86RegisterInfo::hasBasePointer (const MachineFunction &MF) const {
437441 const MachineFrameInfo *MFI = MF.getFrameInfo ();
438442
@@ -445,9 +449,7 @@ bool X86RegisterInfo::hasBasePointer(const MachineFunction &MF) const {
445449 // reference locals while also adjusting the stack pointer. When we can't
446450 // use both the SP and the FP, we need a separate base pointer register.
447451 bool CantUseFP = needsStackRealignment (MF);
448- bool CantUseSP =
449- MFI->hasVarSizedObjects () || MFI->hasOpaqueSPAdjustment ();
450- return CantUseFP && CantUseSP;
452+ return CantUseFP && CantUseSP (MFI);
451453}
452454
453455bool X86RegisterInfo::canRealignStack (const MachineFunction &MF) const {
@@ -464,7 +466,7 @@ bool X86RegisterInfo::canRealignStack(const MachineFunction &MF) const {
464466
465467 // If a base pointer is necessary. Check that it isn't too late to reserve
466468 // it.
467- if (MFI-> hasVarSizedObjects ( ))
469+ if (CantUseSP (MFI ))
468470 return MRI->canReserveReg (BasePtr);
469471 return true ;
470472}
You can’t perform that action at this time.
0 commit comments