1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
llvm-mirror/lib/Target/XCore/XCoreMachineFunctionInfo.cpp
Robert Lytton aec919de4b XCore target: Make handling of large frames not dependent upon an FP.
eliminateFrameIndex() has been reworked to handle both small & large frames
with either a FP or SP.
An additional Slot is required for Scavenging spills when not using FP for large frames.
Reworked the handling of Register Scavenging.

Whether we are using an FP or not, whether it is a large frame or not,
and whether we are using a large code model or not are now independent.

llvm-svn: 196091
2013-12-02 11:05:28 +00:00

31 lines
1.2 KiB
C++

//===-- XCoreMachineFuctionInfo.cpp - XCore machine function info ---------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "XCoreMachineFunctionInfo.h"
using namespace llvm;
void XCoreFunctionInfo::anchor() { }
bool XCoreFunctionInfo::isLargeFrame(const MachineFunction &MF) const {
if (CachedEStackSize == -1) {
CachedEStackSize = MF.getFrameInfo()->estimateStackSize(MF);
}
// isLargeFrame() is used when deciding if spill slots should be added to
// allow eliminateFrameIndex() to scavenge registers.
// This is only required when there is no FP and offsets are greater than
// ~256KB (~64Kwords). Thus only for code run on the emulator!
//
// The arbitrary value of 0xf000 allows frames of up to ~240KB before spill
// slots are added for the use of eliminateFrameIndex() register scavenging.
// For frames less than 240KB, it is assumed that there will be less than
// 16KB of function arguments.
return CachedEStackSize > 0xf000;
}