1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

For Thumb2, try to use frame pointer references for stack slots even when a

base register is available. rdar://8525298

llvm-svn: 116729
This commit is contained in:
Jim Grosbach 2010-10-18 18:39:46 +00:00
parent 7cc236c87f
commit ffb06eda57

View File

@ -953,8 +953,16 @@ ARMBaseRegisterInfo::ResolveFrameIndexReference(const MachineFunction &MF,
return FPOffset;
} else if (MFI->hasVarSizedObjects()) {
assert(hasBasePointer(MF) && "missing base pointer!");
// Use the base register since we have it.
FrameReg = BasePtr;
// Try to use the frame pointer if we can, else use the base pointer
// since it's available. This is handy for the emergency spill slot, in
// particular.
if (AFI->isThumb2Function()) {
if (FPOffset >= -255 && FPOffset < 0) {
FrameReg = getFrameRegister(MF);
return FPOffset;
}
} else
FrameReg = BasePtr;
} else if (AFI->isThumb2Function()) {
// In Thumb2 mode, the negative offset is very limited. Try to avoid
// out of range references.