LLVM API Documentation
#include <Thumb1FrameLowering.h>
Public Member Functions | |
Thumb1FrameLowering (const ARMSubtarget &sti) | |
void | emitPrologue (MachineFunction &MF) const override |
void | emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) 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 | eliminateCallFramePseudoInstr (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override |
Definition at line 24 of file Thumb1FrameLowering.h.
Thumb1FrameLowering::Thumb1FrameLowering | ( | const ARMSubtarget & | sti | ) | [explicit] |
Definition at line 24 of file Thumb1FrameLowering.cpp.
void Thumb1FrameLowering::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::ARMFrameLowering.
Definition at line 52 of file Thumb1FrameLowering.cpp.
References Align(), emitSPUpdate(), llvm::MachineBasicBlock::erase(), llvm::MachineInstr::getDebugLoc(), llvm::MachineOperand::getImm(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFunction::getSubtarget(), hasReservedCallFrame(), I, and TII.
void Thumb1FrameLowering::emitEpilogue | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB | ||
) | const [override, virtual] |
Reimplemented from llvm::ARMFrameLowering.
Definition at line 318 of file Thumb1FrameLowering.cpp.
References llvm::AddDefaultPred(), llvm::MachineInstrBuilder::addReg(), Align(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MachineInstrBuilder::copyImplicitOps(), llvm::RegState::Define, emitSPUpdate(), llvm::emitThumbRegPlusImmediate(), llvm::MachineBasicBlock::erase(), FramePtr, llvm::MachineBasicBlock::front(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::ARMFunctionInfo::getDPRCalleeSavedAreaSize(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getFrameLowering(), llvm::ARMFunctionInfo::getFramePtrSpillOffset(), llvm::ARMFunctionInfo::getGPRCalleeSavedArea1Size(), llvm::ARMFunctionInfo::getGPRCalleeSavedArea2Size(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::MachineInstr::getOpcode(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::ARMFunctionInfo::getReturnRegsCount(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::TargetMachine::getSubtargetImpl(), llvm::MachineFunction::getTarget(), llvm::ARMFunctionInfo::hasStackFrame(), llvm::ARMSubtarget::hasV4TOps(), llvm::ARMSubtarget::hasV5TOps(), isCSRestore(), llvm::MachineRegisterInfo::isPhysRegUsed(), llvm::RegState::Kill, llvm::ARMFunctionInfo::shouldRestoreSPFromFP(), llvm::ARMFrameLowering::STI, TII, and llvm::tryFoldSPUpdateIntoPushPop().
void Thumb1FrameLowering::emitPrologue | ( | MachineFunction & | MF | ) | const [override, virtual] |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Reimplemented from llvm::ARMFrameLowering.
Definition at line 85 of file Thumb1FrameLowering.cpp.
References llvm::AddDefaultPred(), llvm::MachineInstrBuilder::addImm(), Align(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::TargetOpcode::CFI_INSTRUCTION, llvm::MCCFIInstruction::createDefCfa(), llvm::MCCFIInstruction::createDefCfaOffset(), llvm::MCCFIInstruction::createDefCfaRegister(), llvm::MCCFIInstruction::createOffset(), emitSPUpdate(), llvm::MachineBasicBlock::end(), FramePtr, llvm::MachineInstr::FrameSetup, llvm::MachineFunction::front(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::ARMBaseRegisterInfo::getBaseRegister(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getFrameLowering(), llvm::ARMFunctionInfo::getFramePtrSpillOffset(), llvm::ARMBaseRegisterInfo::getFrameRegister(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getMMI(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineFrameInfo::getOffsetAdjustment(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::TargetMachine::getSubtargetImpl(), llvm::MachineFunction::getTarget(), llvm::ARMBaseRegisterInfo::hasBasePointer(), llvm::ARMFrameLowering::hasFP(), llvm::ARMFunctionInfo::hasStackFrame(), llvm::MachineFrameInfo::hasVarSizedObjects(), I, llvm::ARMSubtarget::isTargetELF(), llvm::ARMSubtarget::isTargetMachO(), llvm::ARMBaseRegisterInfo::needsStackRealignment(), llvm::report_fatal_error(), llvm::ARMFunctionInfo::setDPRCalleeSavedAreaOffset(), llvm::ARMFunctionInfo::setDPRCalleeSavedAreaSize(), llvm::ARMFunctionInfo::setFramePtrSpillOffset(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea1Offset(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea1Size(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea2Offset(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea2Size(), llvm::MachineInstrBuilder::setMIFlags(), llvm::MachineFrameInfo::setOffsetAdjustment(), llvm::ARMFunctionInfo::setShouldRestoreSPFromFP(), llvm::MachineFrameInfo::setStackSize(), llvm::ARMFrameLowering::STI, TII, and llvm::tryFoldSPUpdateIntoPushPop().
bool Thumb1FrameLowering::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::ARMFrameLowering.
Definition at line 27 of file Thumb1FrameLowering.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getMaxCallFrameSize(), and llvm::MachineFrameInfo::hasVarSizedObjects().
Referenced by eliminateCallFramePseudoInstr().
bool Thumb1FrameLowering::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::ARMFrameLowering.
Definition at line 493 of file Thumb1FrameLowering.cpp.
References llvm::AddDefaultPred(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineInstrBuilder::copyImplicitOps(), llvm::MachineFunction::DeleteMachineInstr(), llvm::MachineBasicBlock::erase(), llvm::DebugLoc::get(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::getDefRegState(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), llvm::ARMSubtarget::hasV4TOps(), llvm::ARMSubtarget::hasV5TOps(), llvm::MachineBasicBlock::insert(), llvm::ARMFrameLowering::STI, and TII.
bool Thumb1FrameLowering::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::ARMFrameLowering.
Definition at line 454 of file Thumb1FrameLowering.cpp.
References llvm::AddDefaultPred(), llvm::MachineBasicBlock::addLiveIn(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::FrameSetup, llvm::MCInstrInfo::get(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::getKillRegState(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineRegisterInfo::isLiveIn(), llvm::MachineFrameInfo::isReturnAddressTaken(), llvm::MachineInstrBuilder::setMIFlags(), and TII.