[llvm] r299562 - ARMFrameLowering: Slight cleanups; NFC
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 5 09:58:42 PDT 2017
Author: matze
Date: Wed Apr 5 11:58:41 2017
New Revision: 299562
URL: http://llvm.org/viewvc/llvm-project?rev=299562&view=rev
Log:
ARMFrameLowering: Slight cleanups; NFC
Modified:
llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp?rev=299562&r1=299561&r2=299562&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp Wed Apr 5 11:58:41 2017
@@ -1700,13 +1700,14 @@ void ARMFrameLowering::determineCalleeSa
// worth the effort and added fragility?
unsigned EstimatedStackSize =
MFI.estimateStackSize(MF) + 4 * (NumGPRSpills + NumFPRSpills);
- if (hasFP(MF)) {
+ bool HasFP = hasFP(MF);
+ if (HasFP) {
if (AFI->hasStackFrame())
EstimatedStackSize += 4;
} else {
// If FP is not used, SP will be used to access arguments, so count the
// size of arguments into the estimation.
- EstimatedStackSize += MF.getInfo<ARMFunctionInfo>()->getArgumentStackSize();
+ EstimatedStackSize += AFI->getArgumentStackSize();
}
EstimatedStackSize += 16; // For possible paddings.
@@ -1717,7 +1718,7 @@ void ARMFrameLowering::determineCalleeSa
if (BigStack || !CanEliminateFrame || RegInfo->cannotEliminateFrame(MF)) {
AFI->setHasStackFrame(true);
- if (hasFP(MF)) {
+ if (HasFP) {
SavedRegs.set(FramePtr);
// If the frame pointer is required by the ABI, also spill LR so that we
// emit a complete frame record.
@@ -1788,7 +1789,7 @@ void ARMFrameLowering::determineCalleeSa
}
// r7 can be used if it is not being used as the frame pointer.
- if (!hasFP(MF)) {
+ if (!HasFP) {
if (SavedRegs.test(ARM::R7)) {
--RegDeficit;
DEBUG(dbgs() << "%R7 is saved low register, RegDeficit = "
More information about the llvm-commits
mailing list