LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
llvm::XCoreFrameLowering Class Reference

#include <XCoreFrameLowering.h>

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

Public Member Functions

 XCoreFrameLowering (const XCoreSubtarget &STI)
 
void emitPrologue (MachineFunction &MF) const
 
void emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) const
 
bool spillCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const
 
bool restoreCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const
 
void eliminateCallFramePseudoInstr (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const
 
bool hasFP (const MachineFunction &MF) const
 
void processFunctionBeforeCalleeSavedScan (MachineFunction &MF, RegScavenger *RS=NULL) const
 
- Public Member Functions inherited from llvm::TargetFrameLowering
 TargetFrameLowering (StackDirection D, unsigned StackAl, int LAO, unsigned TransAl=1, bool StackReal=true)
 
virtual ~TargetFrameLowering ()
 
StackDirection getStackGrowthDirection () const
 
unsigned getStackAlignment () const
 
unsigned getTransientStackAlignment () const
 
bool isStackRealignable () const
 
int getOffsetOfLocalArea () const
 
virtual bool isFPCloseToIncomingSP () const
 
virtual const SpillSlotgetCalleeSavedSpillSlots (unsigned &NumEntries) const
 
virtual bool targetHandlesStackFrameRounding () const
 
virtual void adjustForSegmentedStacks (MachineFunction &MF) const
 
virtual void adjustForHiPEPrologue (MachineFunction &MF) const
 
virtual bool hasReservedCallFrame (const MachineFunction &MF) const
 
virtual bool canSimplifyCallFramePseudos (const MachineFunction &MF) const
 
virtual int getFrameIndexOffset (const MachineFunction &MF, int FI) const
 
virtual int getFrameIndexReference (const MachineFunction &MF, int FI, unsigned &FrameReg) const
 
virtual void processFunctionBeforeFrameFinalized (MachineFunction &MF, RegScavenger *RS=NULL) const
 

Static Public Member Functions

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

Additional Inherited Members

- Public Types inherited from llvm::TargetFrameLowering
enum  StackDirection { StackGrowsUp, StackGrowsDown }
 

Detailed Description

Definition at line 24 of file XCoreFrameLowering.h.

Constructor & Destructor Documentation

XCoreFrameLowering::XCoreFrameLowering ( const XCoreSubtarget STI)

Definition at line 76 of file XCoreFrameLowering.cpp.

Member Function Documentation

void XCoreFrameLowering::eliminateCallFramePseudoInstr ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI 
) const
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 335 of file XCoreFrameLowering.cpp.

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

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

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

Implements llvm::TargetFrameLowering.

Definition at line 86 of file XCoreFrameLowering.cpp.

References llvm::MachineModuleInfo::addFrameInst(), llvm::MachineBasicBlock::addLiveIn(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MCCFIInstruction::createDefCfaOffset(), llvm::MCCFIInstruction::createDefCfaRegister(), llvm::MCCFIInstruction::createOffset(), llvm::MCContext::CreateTempSymbol(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::front(), llvm::Function::getAttributes(), llvm::MachineModuleInfo::getContext(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::XCoreFunctionInfo::getFPSpillSlot(), llvm::CalleeSavedInfo::getFrameIdx(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::TargetMachine::getInstrInfo(), llvm::XCoreFunctionInfo::getLRSpillSlot(), llvm::MachineFrameInfo::getMaxAlignment(), llvm::MachineFunction::getMMI(), llvm::MachineFrameInfo::getObjectOffset(), llvm::CalleeSavedInfo::getReg(), llvm::MCContext::getRegisterInfo(), llvm::XCoreFunctionInfo::getSpillLabels(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getTarget(), llvm::XCoreFunctionInfo::getUsesLR(), llvm::AttributeSet::hasAttrSomewhere(), hasFP(), I, isImmU16(), isImmU6(), loadFromStack(), MRI, llvm::XCoreRegisterInfo::needsFrameMoves(), llvm::Attribute::Nest, llvm::TargetOpcode::PROLOG_LABEL, llvm::report_fatal_error(), storeToStack(), and TII.

bool XCoreFrameLowering::hasFP ( const MachineFunction MF) const
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 81 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(), and processFunctionBeforeCalleeSavedScan().

void XCoreFrameLowering::processFunctionBeforeCalleeSavedScan ( MachineFunction MF,
RegScavenger RS = NULL 
) const
virtual
bool XCoreFrameLowering::restoreCalleeSavedRegisters ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI,
const TargetRegisterInfo TRI 
) const
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 301 of file XCoreFrameLowering.cpp.

References llvm::MachineBasicBlock::begin(), llvm::TargetMachine::getInstrInfo(), llvm::TargetRegisterInfo::getMinimalPhysRegClass(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getTarget(), llvm::TargetInstrInfo::loadRegFromStackSlot(), llvm::A64CC::MI, and TII.

bool XCoreFrameLowering::spillCalleeSavedRegisters ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI,
const TargetRegisterInfo TRI 
) const
virtual
static int llvm::XCoreFrameLowering::stackSlotSize ( )
inlinestatic

Stack slot size (4 bytes)

Definition at line 52 of file XCoreFrameLowering.h.


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