summaryrefslogtreecommitdiffstats
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
commitf43d679951672b1758bade6f505c7c967812d65c (patch)
treee9696a1d440023c2db0d2369ba1e5b4acaa8ca58
parent42a1cb7c0c0857f47a6028e6d70d0b9d896a02bc (diff)
downloadbcm5719-llvm-f43d679951672b1758bade6f505c7c967812d65c.tar.gz
bcm5719-llvm-f43d679951672b1758bade6f505c7c967812d65c.zip
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. llvm-svn: 32820
-rw-r--r--llvm/include/llvm/Target/MRegisterInfo.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/include/llvm/Target/MRegisterInfo.h b/llvm/include/llvm/Target/MRegisterInfo.h
index a45d53aa3c5..c5a41872499 100644
--- a/llvm/include/llvm/Target/MRegisterInfo.h
+++ b/llvm/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,
OpenPOWER on IntegriCloud