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
This commit is contained in:
Evan Cheng 2007-01-02 20:55:17 +00:00
parent 42525a3c5b
commit ebdf389e2f

View File

@ -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,