aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Target/MRegisterInfo.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-01-02 20:55:17 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-01-02 20:55:17 +0000
commitebdf389e2f0af7e90c7adf3f329e60a4e007ee70 (patch)
tree1c48013129b8464889a644b45ea61eb10c1435b5 /include/llvm/Target/MRegisterInfo.h
parent42525a3c5bd6812dbe0938994b3ee98f5fc6136b (diff)
downloadexternal_llvm-ebdf389e2f0af7e90c7adf3f329e60a4e007ee70.zip
external_llvm-ebdf389e2f0af7e90c7adf3f329e60a4e007ee70.tar.gz
external_llvm-ebdf389e2f0af7e90c7adf3f329e60a4e007ee70.tar.bz2
Add virtual method spillCalleeSaveRegisters() and restoreCalleeSaveRegisters()
to MRegisterInfo. These allow the target to issue instructions to spill and restore callee saved registers in case where individual stores / loads aren't the correct / profitable choice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/MRegisterInfo.h')
-rw-r--r--include/llvm/Target/MRegisterInfo.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/llvm/Target/MRegisterInfo.h b/include/llvm/Target/MRegisterInfo.h
index a45d53a..c5a4187 100644
--- a/include/llvm/Target/MRegisterInfo.h
+++ b/include/llvm/Target/MRegisterInfo.h
@@ -29,6 +29,7 @@ class MachineInstr;
class MachineLocation;
class MachineMove;
class TargetRegisterClass;
+class CalleeSavedInfo;
/// TargetRegisterDesc - This record contains all of the information known about
/// a particular register. The AliasSet field (if not null) contains a pointer
@@ -319,6 +320,26 @@ public:
// immediates and memory. FIXME: Move these to TargetInstrInfo.h.
//
+ /// spillCalleeSaveRegisters - Issues instruction(s) to spill all callee saved
+ /// registers and returns true if it isn't possible / profitable to do so by
+ /// issuing a series of store instructions via storeRegToStackSlot(). Returns
+ /// false otherwise.
+ virtual bool spillCalleeSaveRegisters(MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator MI,
+ const std::vector<CalleeSavedInfo> &CSI) const {
+ return false;
+ }
+
+ /// restoreCalleeSaveRegisters - Issues instruction(s) to restore all callee
+ /// saved registers and returns true if it isn't possible / profitable to do
+ /// so by issuing a series of load instructions via loadRegToStackSlot().
+ /// Returns false otherwise.
+ virtual bool restoreCalleeSaveRegisters(MachineBasicBlock &MBB,
+ MachineBasicBlock::iterator MI,
+ const std::vector<CalleeSavedInfo> &CSI) const {
+ return false;
+ }
+
virtual void storeRegToStackSlot(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI,
unsigned SrcReg, int FrameIndex,