LLVM API Documentation
#include <MSP430FrameLowering.h>
Public Member Functions | |
MSP430FrameLowering () | |
void | emitPrologue (MachineFunction &MF) const override |
void | emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) const override |
void | eliminateCallFramePseudoInstr (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override |
bool | spillCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override |
bool | restoreCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override |
bool | hasFP (const MachineFunction &MF) const override |
bool | hasReservedCallFrame (const MachineFunction &MF) const override |
void | processFunctionBeforeFrameFinalized (MachineFunction &MF, RegScavenger *RS=nullptr) const override |
Definition at line 21 of file MSP430FrameLowering.h.
llvm::MSP430FrameLowering::MSP430FrameLowering | ( | ) | [inline, explicit] |
Definition at line 25 of file MSP430FrameLowering.h.
void MSP430FrameLowering::eliminateCallFramePseudoInstr | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB, | ||
MachineBasicBlock::iterator | MI | ||
) | const [override, virtual] |
eliminateCallFramePseudoInstr - This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy pseudo instructions (but only if the Target is using them). It is responsible for eliminating these instructions, replacing them with concrete instructions. This method need only be implemented if using call frame setup/destroy pseudo instructions.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 227 of file MSP430FrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), llvm::MachineBasicBlock::erase(), llvm::MachineInstr::getDebugLoc(), llvm::MachineOperand::getImm(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFunction::getSubtarget(), hasReservedCallFrame(), I, llvm::MachineBasicBlock::insert(), llvm::MachineOperand::setIsDead(), and TII.
void MSP430FrameLowering::emitEpilogue | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB | ||
) | const [override, virtual] |
Implements llvm::TargetFrameLowering.
Definition at line 107 of file MSP430FrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::DebugLoc::get(), llvm::MSP430MachineFunctionInfo::getCalleeSavedFrameSize(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::MachineInstr::getOperand(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), hasFP(), llvm::MachineFrameInfo::hasVarSizedObjects(), llvm_unreachable, llvm::AArch64CC::MI, llvm::MachineOperand::setIsDead(), and TII.
void MSP430FrameLowering::emitPrologue | ( | MachineFunction & | MF | ) | const [override, virtual] |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Implements llvm::TargetFrameLowering.
Definition at line 42 of file MSP430FrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::MachineFunction::front(), llvm::DebugLoc::get(), llvm::MSP430MachineFunctionInfo::getCalleeSavedFrameSize(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineInstr::getOperand(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), hasFP(), I, llvm::RegState::Kill, llvm::AArch64CC::MI, llvm::MachineOperand::setIsDead(), llvm::MachineFrameInfo::setOffsetAdjustment(), and TII.
bool MSP430FrameLowering::hasFP | ( | const MachineFunction & | MF | ) | const [override, virtual] |
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.
Implements llvm::TargetFrameLowering.
Definition at line 30 of file MSP430FrameLowering.cpp.
References llvm::TargetOptions::DisableFramePointerElim(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getTarget(), llvm::MachineFrameInfo::hasVarSizedObjects(), llvm::MachineFrameInfo::isFrameAddressTaken(), and llvm::TargetMachine::Options.
Referenced by emitEpilogue(), emitPrologue(), and processFunctionBeforeFrameFinalized().
bool MSP430FrameLowering::hasReservedCallFrame | ( | const MachineFunction & | MF | ) | const [override, virtual] |
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.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 38 of file MSP430FrameLowering.cpp.
References llvm::MachineFunction::getFrameInfo(), and llvm::MachineFrameInfo::hasVarSizedObjects().
Referenced by eliminateCallFramePseudoInstr().
void MSP430FrameLowering::processFunctionBeforeFrameFinalized | ( | MachineFunction & | MF, |
RegScavenger * | RS = nullptr |
||
) | const [override, virtual] |
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function's frame layout (MF.getFrameInfo()) is finalized. Once the frame is finalized, MO_FrameIndex operands are replaced with direct constants. This method is optional.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 289 of file MSP430FrameLowering.cpp.
References llvm::MachineFrameInfo::CreateFixedObject(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getObjectIndexBegin(), and hasFP().
bool MSP430FrameLowering::restoreCalleeSavedRegisters | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MI, | ||
const std::vector< CalleeSavedInfo > & | CSI, | ||
const TargetRegisterInfo * | TRI | ||
) | const [override, virtual] |
restoreCalleeSavedRegisters - 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.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 207 of file MSP430FrameLowering.cpp.
References llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::MCInstrInfo::get(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), and TII.
bool MSP430FrameLowering::spillCalleeSavedRegisters | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MI, | ||
const std::vector< CalleeSavedInfo > & | CSI, | ||
const TargetRegisterInfo * | TRI | ||
) | const [override, virtual] |
spillCalleeSavedRegisters - 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.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 181 of file MSP430FrameLowering.cpp.
References llvm::MachineBasicBlock::addLiveIn(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::MCInstrInfo::get(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), llvm::RegState::Kill, llvm::MSP430MachineFunctionInfo::setCalleeSavedFrameSize(), and TII.