aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target/TargetFrameInfo.h
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2010-11-18 21:19:35 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2010-11-18 21:19:35 +0000
commitd0c38176690e9602a93a20a43f1bd084564a8116 (patch)
treed4c7a39ff5665d4adb34f193c2256f1c6d033181 /include/llvm/Target/TargetFrameInfo.h
parentb9064bb96458ab48a878e1a7e678cada2e22ab7a (diff)
downloadexternal_llvm-d0c38176690e9602a93a20a43f1bd084564a8116.tar.gz
external_llvm-d0c38176690e9602a93a20a43f1bd084564a8116.tar.bz2
external_llvm-d0c38176690e9602a93a20a43f1bd084564a8116.zip
Move hasFP() and few related hooks to TargetFrameInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetFrameInfo.h')
-rw-r--r--include/llvm/Target/TargetFrameInfo.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetFrameInfo.h b/include/llvm/Target/TargetFrameInfo.h
index 6143f3c549..d8d0ca1edd 100644
--- a/include/llvm/Target/TargetFrameInfo.h
+++ b/include/llvm/Target/TargetFrameInfo.h
@@ -105,6 +105,32 @@ public:
virtual void emitPrologue(MachineFunction &MF) const = 0;
virtual void emitEpilogue(MachineFunction &MF,
MachineBasicBlock &MBB) const = 0;
+
+ /// hasFP - Return true if the specified function should have a dedicated
+ /// frame pointer register. For most targets this is true only if the function
+ /// has variable sized allocas or if frame pointer elimination is disabled.
+ virtual bool hasFP(const MachineFunction &MF) const = 0;
+
+ /// hasReservedCallFrame - Under normal circumstances, when a frame pointer is
+ /// not required, we reserve argument space for call sites in the function
+ /// immediately on entry to the current function. This eliminates the need for
+ /// add/sub sp brackets around call sites. Returns true if the call frame is
+ /// included as part of the stack frame.
+ virtual bool hasReservedCallFrame(const MachineFunction &MF) const {
+ return !hasFP(MF);
+ }
+
+ /// canSimplifyCallFramePseudos - When possible, it's best to simplify the
+ /// call frame pseudo ops before doing frame index elimination. This is
+ /// possible only when frame index references between the pseudos won't
+ /// need adjusting for the call frame adjustments. Normally, that's true
+ /// if the function has a reserved call frame or a frame pointer. Some
+ /// targets (Thumb2, for example) may have more complicated criteria,
+ /// however, and can override this behavior.
+ virtual bool canSimplifyCallFramePseudos(const MachineFunction &MF) const {
+ return hasReservedCallFrame(MF) || hasFP(MF);
+ }
+
};
} // End llvm namespace