LLVM API Documentation
#include <Mips16FrameLowering.h>
Public Member Functions | |
Mips16FrameLowering (const MipsSubtarget &STI) | |
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 | hasReservedCallFrame (const MachineFunction &MF) const override |
void | processFunctionBeforeCalleeSavedScan (MachineFunction &MF, RegScavenger *RS) const override |
Definition at line 20 of file Mips16FrameLowering.h.
Mips16FrameLowering::Mips16FrameLowering | ( | const MipsSubtarget & | STI | ) | [explicit] |
Definition at line 32 of file Mips16FrameLowering.cpp.
void Mips16FrameLowering::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 148 of file Mips16FrameLowering.cpp.
References llvm::Mips16InstrInfo::adjustStackPtr(), llvm::MachineBasicBlock::erase(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getSubtarget(), hasReservedCallFrame(), and TII.
void Mips16FrameLowering::emitEpilogue | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB | ||
) | const [override, virtual] |
Implements llvm::TargetFrameLowering.
Definition at line 82 of file Mips16FrameLowering.cpp.
References llvm::BuildMI(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::MipsFrameLowering::hasFP(), llvm::Mips16InstrInfo::restoreFrame(), and TII.
void Mips16FrameLowering::emitPrologue | ( | MachineFunction & | MF | ) | const [override, virtual] |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Implements llvm::TargetFrameLowering.
Definition at line 35 of file Mips16FrameLowering.cpp.
References llvm::MachineModuleInfo::addFrameInst(), llvm::MachineFrameInfo::adjustsStack(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::TargetOpcode::CFI_INSTRUCTION, llvm::MCCFIInstruction::createDefCfaOffset(), llvm::MCCFIInstruction::createOffset(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::FrameSetup, llvm::MachineFunction::front(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineModuleInfo::getContext(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getMMI(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MCContext::getRegisterInfo(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::MipsFrameLowering::hasFP(), I, llvm::Mips16InstrInfo::makeFrame(), llvm::MachineInstrBuilder::setMIFlag(), and TII.
bool Mips16FrameLowering::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 166 of file Mips16FrameLowering.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getMaxCallFrameSize(), and llvm::MachineFrameInfo::hasVarSizedObjects().
Referenced by eliminateCallFramePseudoInstr().
void Mips16FrameLowering::processFunctionBeforeCalleeSavedScan | ( | MachineFunction & | MF, |
RegScavenger * | RS | ||
) | const [override, virtual] |
processFunctionBeforeCalleeSavedScan - This method is called immediately before PrologEpilogInserter scans the physical registers used to determine what callee saved registers should be spilled. This method is optional.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 174 of file Mips16FrameLowering.cpp.
References llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getRegInfo(), llvm::Mips16InstrInfo::getRegisterInfo(), llvm::MipsRegisterInfo::getReservedRegs(), llvm::MachineFunction::getSubtarget(), llvm::MipsFrameLowering::hasFP(), llvm::MachineRegisterInfo::setPhysRegUsed(), and TII.
bool Mips16FrameLowering::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 132 of file Mips16FrameLowering.cpp.
bool Mips16FrameLowering::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 104 of file Mips16FrameLowering.cpp.
References llvm::MachineBasicBlock::addLiveIn(), llvm::MachineFunction::begin(), llvm::MachineFunction::getFrameInfo(), llvm::MachineBasicBlock::getParent(), and llvm::MachineFrameInfo::isReturnAddressTaken().