LLVM API Documentation

Public Member Functions | Static Public Member Functions
llvm::XCoreFrameLowering Class Reference

#include <XCoreFrameLowering.h>

Inheritance diagram for llvm::XCoreFrameLowering:
Inheritance graph
[legend]
Collaboration diagram for llvm::XCoreFrameLowering:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 XCoreFrameLowering (const XCoreSubtarget &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
void eliminateCallFramePseudoInstr (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override
bool hasFP (const MachineFunction &MF) const override
void processFunctionBeforeCalleeSavedScan (MachineFunction &MF, RegScavenger *RS=nullptr) const override
void processFunctionBeforeFrameFinalized (MachineFunction &MF, RegScavenger *RS=nullptr) const override

Static Public Member Functions

static int stackSlotSize ()
 Stack slot size (4 bytes)

Detailed Description

Definition at line 24 of file XCoreFrameLowering.h.


Constructor & Destructor Documentation

Definition at line 213 of file XCoreFrameLowering.cpp.


Member Function Documentation

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 482 of file XCoreFrameLowering.cpp.

References Align(), llvm::BuildMI(), llvm::MachineBasicBlock::erase(), llvm::errs(), llvm::MachineInstr::getDebugLoc(), llvm::MachineOperand::getImm(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFunction::getSubtarget(), llvm::TargetFrameLowering::hasReservedCallFrame(), I, llvm::MachineBasicBlock::insert(), isImmU16(), isImmU6(), llvm_unreachable, and TII.

void XCoreFrameLowering::emitEpilogue ( MachineFunction MF,
MachineBasicBlock MBB 
) const [override, virtual]
void XCoreFrameLowering::emitPrologue ( MachineFunction MF) const [override, virtual]

emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.

Implements llvm::TargetFrameLowering.

Definition at line 223 of file XCoreFrameLowering.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::addLiveIn(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstr::addRegisterKilled(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), EmitCfiOffset(), EmitDefCfaOffset(), EmitDefCfaRegister(), llvm::SmallVectorTemplateCommon< T >::end(), FramePtr, llvm::MachineFunction::front(), llvm::Function::getAttributes(), llvm::MachineModuleInfo::getContext(), llvm::MCRegisterInfo::getDwarfRegNum(), GetEHSpillList(), llvm::CalleeSavedInfo::getFrameIdx(), getFrameIndexMMO(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::XCoreFunctionInfo::getLRSpillSlot(), llvm::MachineFrameInfo::getMaxAlignment(), llvm::MachineFunction::getMMI(), llvm::MachineFrameInfo::getObjectOffset(), llvm::CalleeSavedInfo::getReg(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MCContext::getRegisterInfo(), llvm::XCoreFunctionInfo::getSpillLabels(), GetSpillList(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::AttributeSet::hasAttrSomewhere(), llvm::XCoreFunctionInfo::hasEHSpillSlot(), hasFP(), llvm::XCoreFunctionInfo::hasLRSpillSlot(), I, IfNeededExtSP(), isImmU6(), llvm::RegState::Kill, MaxImmU16, llvm::MachineMemOperand::MOStore, llvm::XCoreRegisterInfo::needsFrameMoves(), llvm::Attribute::Nest, llvm::report_fatal_error(), llvm::SmallVectorTemplateCommon< T >::size(), and TII.

bool XCoreFrameLowering::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 218 of file XCoreFrameLowering.cpp.

References llvm::TargetOptions::DisableFramePointerElim(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getTarget(), llvm::MachineFrameInfo::hasVarSizedObjects(), and llvm::TargetMachine::Options.

Referenced by emitEpilogue(), emitPrologue(), processFunctionBeforeCalleeSavedScan(), processFunctionBeforeFrameFinalized(), restoreCalleeSavedRegisters(), and spillCalleeSavedRegisters().

void XCoreFrameLowering::processFunctionBeforeCalleeSavedScan ( MachineFunction MF,
RegScavenger RS = nullptr 
) const [override, virtual]
void XCoreFrameLowering::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 567 of file XCoreFrameLowering.cpp.

References llvm::RegScavenger::addScavengingFrameIndex(), llvm::MachineFrameInfo::CreateStackObject(), llvm::TargetRegisterClass::getAlignment(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::TargetRegisterClass::getSize(), hasFP(), and llvm::XCoreFunctionInfo::isLargeFrame().

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 447 of file XCoreFrameLowering.cpp.

References llvm::MachineBasicBlock::begin(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::TargetRegisterInfo::getMinimalPhysRegClass(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), hasFP(), llvm::TargetInstrInfo::loadRegFromStackSlot(), llvm::AArch64CC::MI, and TII.

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 411 of file XCoreFrameLowering.cpp.

References llvm::MachineBasicBlock::addLiveIn(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::TargetRegisterInfo::getMinimalPhysRegClass(), llvm::MachineBasicBlock::getParent(), llvm::XCoreFunctionInfo::getSpillLabels(), llvm::MachineFunction::getSubtarget(), hasFP(), llvm::AArch64CC::MI, llvm::XCoreRegisterInfo::needsFrameMoves(), llvm::SPII::Store, llvm::TargetInstrInfo::storeRegToStackSlot(), and TII.

static int llvm::XCoreFrameLowering::stackSlotSize ( ) [inline, static]

Stack slot size (4 bytes)

Definition at line 56 of file XCoreFrameLowering.h.


The documentation for this class was generated from the following files: