summaryrefslogtreecommitdiff
path: root/lib/Target/XCore/XCoreMachineFunctionInfo.cpp
diff options
context:
space:
mode:
authorRobert Lytton <robert@xmos.com>2013-12-02 11:05:28 +0000
committerRobert Lytton <robert@xmos.com>2013-12-02 11:05:28 +0000
commitf19c6f576367a368cf729cd0019d16d691163d72 (patch)
treec3ae3e7de6723c0205d29aa88c0f5c606cd2b080 /lib/Target/XCore/XCoreMachineFunctionInfo.cpp
parentf715d5176953dde487969561f0140bd55bd5daf6 (diff)
downloadllvm-f19c6f576367a368cf729cd0019d16d691163d72.tar.gz
llvm-f19c6f576367a368cf729cd0019d16d691163d72.tar.bz2
llvm-f19c6f576367a368cf729cd0019d16d691163d72.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196091 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/XCore/XCoreMachineFunctionInfo.cpp')
-rw-r--r--lib/Target/XCore/XCoreMachineFunctionInfo.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/XCore/XCoreMachineFunctionInfo.cpp b/lib/Target/XCore/XCoreMachineFunctionInfo.cpp
index 7ca0672912..91b2976008 100644
--- a/lib/Target/XCore/XCoreMachineFunctionInfo.cpp
+++ b/lib/Target/XCore/XCoreMachineFunctionInfo.cpp
@@ -12,3 +12,19 @@
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;
+}