LLVM API Documentation
#include <MipsSEFrameLowering.h>
Public Member Functions | |
MipsSEFrameLowering (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 | hasReservedCallFrame (const MachineFunction &MF) const override |
void | processFunctionBeforeCalleeSavedScan (MachineFunction &MF, RegScavenger *RS) const override |
unsigned | ehDataReg (unsigned I) const |
Definition at line 21 of file MipsSEFrameLowering.h.
MipsSEFrameLowering::MipsSEFrameLowering | ( | const MipsSubtarget & | STI | ) | [explicit] |
Definition at line 395 of file MipsSEFrameLowering.cpp.
unsigned MipsSEFrameLowering::ehDataReg | ( | unsigned | I | ) | const |
Definition at line 398 of file MipsSEFrameLowering.cpp.
References I, llvm::MipsSubtarget::isABI_N64(), and llvm::MipsFrameLowering::STI.
Referenced by emitEpilogue(), and emitPrologue().
void MipsSEFrameLowering::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 643 of file MipsSEFrameLowering.cpp.
References llvm::MipsSEInstrInfo::adjustStackPtr(), llvm::MachineBasicBlock::erase(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getSubtarget(), hasReservedCallFrame(), llvm::MipsSubtarget::isABI_N64(), and llvm::MipsFrameLowering::STI.
void MipsSEFrameLowering::emitEpilogue | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB | ||
) | const [override, virtual] |
Implements llvm::TargetFrameLowering.
Definition at line 543 of file MipsSEFrameLowering.cpp.
References llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MipsFunctionInfo::callsEhReturn(), ehDataReg(), llvm::DebugLoc::get(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MipsFunctionInfo::getEhDataRegFI(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::MipsFrameLowering::hasFP(), llvm::MipsSubtarget::isABI_N64(), and llvm::MipsFrameLowering::STI.
void MipsSEFrameLowering::emitPrologue | ( | MachineFunction & | MF | ) | const [override, virtual] |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Implements llvm::TargetFrameLowering.
Definition at line 409 of file MipsSEFrameLowering.cpp.
References llvm::MachineModuleInfo::addFrameInst(), llvm::MachineBasicBlock::addLiveIn(), llvm::MachineInstrBuilder::addReg(), llvm::MachineFrameInfo::adjustsStack(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MipsFunctionInfo::callsEhReturn(), llvm::TargetOpcode::CFI_INSTRUCTION, contains(), llvm::MCCFIInstruction::createDefCfaOffset(), llvm::MCCFIInstruction::createDefCfaRegister(), llvm::MCCFIInstruction::createOffset(), ehDataReg(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::FrameSetup, llvm::MachineFunction::front(), llvm::DebugLoc::get(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineModuleInfo::getContext(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MipsFunctionInfo::getEhDataRegFI(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getMMI(), llvm::MachineFrameInfo::getObjectOffset(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MCContext::getRegisterInfo(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::MipsFrameLowering::hasFP(), I, llvm::MipsSubtarget::isABI_N64(), llvm::MipsSubtarget::isLittle(), llvm::MachineBasicBlock::isLiveIn(), llvm::MachineInstrBuilder::setMIFlag(), llvm::MipsFrameLowering::STI, and std::swap().
bool MipsSEFrameLowering::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 630 of file MipsSEFrameLowering.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getMaxCallFrameSize(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFrameInfo::hasVarSizedObjects(), and llvm::isInt< 16 >().
Referenced by eliminateCallFramePseudoInstr().
void MipsSEFrameLowering::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 662 of file MipsSEFrameLowering.cpp.
References llvm::RegScavenger::addScavengingFrameIndex(), llvm::MipsFunctionInfo::callsEhReturn(), llvm::MipsFunctionInfo::createEhDataRegsFI(), llvm::MachineFrameInfo::CreateStackObject(), llvm::MipsFrameLowering::estimateStackSize(), llvm::TargetRegisterClass::getAlignment(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), llvm::TargetRegisterClass::getSize(), llvm::MipsFrameLowering::hasFP(), llvm::MipsSubtarget::hasMips64(), llvm::MipsSubtarget::isABI_N64(), llvm::isInt< 16 >(), llvm::MachineRegisterInfo::setPhysRegUsed(), and llvm::MipsFrameLowering::STI.
bool MipsSEFrameLowering::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 599 of file MipsSEFrameLowering.cpp.
References llvm::MachineBasicBlock::addLiveIn(), llvm::MachineFunction::begin(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::TargetRegisterInfo::getMinimalPhysRegClass(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), llvm::MachineFrameInfo::isReturnAddressTaken(), and llvm::TargetInstrInfo::storeRegToStackSlot().