LLVM API Documentation

Public Member Functions | Protected Attributes
llvm::ARMFrameLowering Class Reference

#include <ARMFrameLowering.h>

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

List of all members.

Public Member Functions

 ARMFrameLowering (const ARMSubtarget &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
bool hasFP (const MachineFunction &MF) const
bool hasReservedCallFrame (const MachineFunction &MF) const
bool canSimplifyCallFramePseudos (const MachineFunction &MF) const
int getFrameIndexReference (const MachineFunction &MF, int FI, unsigned &FrameReg) const
int ResolveFrameIndexReference (const MachineFunction &MF, int FI, unsigned &FrameReg, int SPAdj) const
int getFrameIndexOffset (const MachineFunction &MF, int FI) const
void processFunctionBeforeCalleeSavedScan (MachineFunction &MF, RegScavenger *RS) const

Protected Attributes

const ARMSubtargetSTI

Detailed Description

Definition at line 24 of file ARMFrameLowering.h.


Constructor & Destructor Documentation

llvm::ARMFrameLowering::ARMFrameLowering ( const ARMSubtarget sti) [inline, explicit]

Definition at line 29 of file ARMFrameLowering.h.


Member Function Documentation

bool ARMFrameLowering::canSimplifyCallFramePseudos ( const MachineFunction MF) const [virtual]

canSimplifyCallFramePseudos - If there is a reserved call frame, the call frame pseudos can be simplified. Unlike most targets, having a FP is not sufficient here since we still may reference some objects via SP even when FP is available in Thumb2 mode.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 81 of file ARMFrameLowering.cpp.

References llvm::MachineFunction::getFrameInfo(), hasReservedCallFrame(), and llvm::MachineFrameInfo::hasVarSizedObjects().

Referenced by processFunctionBeforeCalleeSavedScan().

void ARMFrameLowering::emitEpilogue ( MachineFunction MF,
MachineBasicBlock MBB 
) const [virtual]

Implements llvm::TargetFrameLowering.

Reimplemented in llvm::Thumb1FrameLowering.

Definition at line 346 of file ARMFrameLowering.cpp.

References llvm::AddDefaultPred(), llvm::MachineInstrBuilder::addExternalSymbol(), llvm::MachineInstrBuilder::addGlobalAddress(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstr::addOperand(), llvm::MachineInstrBuilder::addReg(), llvm::ARMCC::AL, Align(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::emitARMRegPlusImmediate(), llvm::emitSPUpdate(), llvm::emitT2RegPlusImmediate(), llvm::MachineBasicBlock::erase(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::Function::getCallingConv(), llvm::ARMFunctionInfo::getDPRCalleeSavedAreaSize(), llvm::MachineFunction::getFrameInfo(), llvm::TargetMachine::getFrameLowering(), llvm::ARMFunctionInfo::getFramePtrSpillOffset(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getGlobal(), llvm::ARMFunctionInfo::getGPRCalleeSavedArea1Size(), llvm::ARMFunctionInfo::getGPRCalleeSavedArea2Size(), llvm::MachineFunction::getInfo(), llvm::TargetMachine::getInstrInfo(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::MachineOperand::getOffset(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetMachine::getRegisterInfo(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineOperand::getSymbolName(), llvm::MachineFunction::getTarget(), llvm::MachineOperand::getTargetFlags(), llvm::CallingConv::GHC, llvm::ARMFunctionInfo::hasStackFrame(), isCSRestore(), llvm::MachineOperand::isGlobal(), llvm::MachineRegisterInfo::isPhysRegUsed(), llvm::MachineOperand::isSymbol(), llvm::ARMSubtarget::isTargetIOS(), llvm::ARMSubtarget::isThumb(), llvm::ARMFunctionInfo::isThumb1OnlyFunction(), llvm::ARMFunctionInfo::isThumbFunction(), llvm::RegState::Kill, llvm::prior(), llvm::ARMFunctionInfo::shouldRestoreSPFromFP(), STI, and TII.

void ARMFrameLowering::emitPrologue ( MachineFunction MF) const [virtual]

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

Implements llvm::TargetFrameLowering.

Reimplemented in llvm::Thumb1FrameLowering.

Definition at line 132 of file ARMFrameLowering.cpp.

References llvm::AddDefaultCC(), llvm::AddDefaultPred(), llvm::ARMFunctionInfo::addDPRCalleeSavedAreaFrame(), llvm::ARMFunctionInfo::addGPRCalleeSavedArea1Frame(), llvm::ARMFunctionInfo::addGPRCalleeSavedArea2Frame(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::ARMCC::AL, Align(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::X86II::D8, llvm::emitSPUpdate(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::FrameSetup, llvm::MachineFunction::front(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::Function::getCallingConv(), llvm::MachineFunction::getFrameInfo(), llvm::TargetMachine::getFrameLowering(), llvm::ARMFunctionInfo::getFramePtrSpillOffset(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::TargetMachine::getInstrInfo(), llvm::MachineFrameInfo::getMaxAlignment(), llvm::ARMFunctionInfo::getNumAlignedDPRCS2Regs(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineFrameInfo::getOffsetAdjustment(), llvm::TargetMachine::getRegisterInfo(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getTarget(), llvm::CallingConv::GHC, hasFP(), llvm::ARMFunctionInfo::hasStackFrame(), llvm::MachineFrameInfo::hasVarSizedObjects(), llvm::ARMSubtarget::isTargetELF(), llvm::ARMSubtarget::isTargetIOS(), llvm::ARMFunctionInfo::isThumb1OnlyFunction(), llvm::ARMFunctionInfo::isThumbFunction(), llvm::RegState::Kill, llvm::ARMFunctionInfo::setDPRCalleeSavedAreaOffset(), llvm::ARMFunctionInfo::setDPRCalleeSavedAreaSize(), llvm::ARMFunctionInfo::setFramePtrSpillOffset(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea1Offset(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea1Size(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea2Offset(), llvm::ARMFunctionInfo::setGPRCalleeSavedArea2Size(), llvm::MachineInstrBuilder::setMIFlag(), llvm::MachineFrameInfo::setOffsetAdjustment(), llvm::ARMFunctionInfo::setShouldRestoreSPFromFP(), skipAlignedDPRCS2Spills(), STI, and TII.

int ARMFrameLowering::getFrameIndexOffset ( const MachineFunction MF,
int  FI 
) const [virtual]

getFrameIndexOffset - Returns the displacement from the frame register to the stack frame of the specified index.

getFrameIndexOffset - Returns the displacement from the frame register to the stack frame of the specified index. This is the default implementation which is overridden for some targets.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 572 of file ARMFrameLowering.cpp.

References getFrameIndexReference().

int ARMFrameLowering::getFrameIndexReference ( const MachineFunction MF,
int  FI,
unsigned FrameReg 
) const [virtual]

getFrameIndexReference - Provide a base+offset reference to an FI slot for debug info. It's the same as what we use for resolving the code-gen references for now. FIXME: This can go wrong when references are SP-relative and simple call frames aren't used.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 485 of file ARMFrameLowering.cpp.

References ResolveFrameIndexReference().

Referenced by getFrameIndexOffset().

bool ARMFrameLowering::hasFP ( const MachineFunction MF) const [virtual]
bool ARMFrameLowering::hasReservedCallFrame ( const MachineFunction MF) const [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.

Reimplemented in llvm::Thumb1FrameLowering.

Definition at line 63 of file ARMFrameLowering.cpp.

References llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getMaxCallFrameSize(), and llvm::MachineFrameInfo::hasVarSizedObjects().

Referenced by canSimplifyCallFramePseudos(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), and ResolveFrameIndexReference().

void ARMFrameLowering::processFunctionBeforeCalleeSavedScan ( MachineFunction MF,
RegScavenger RS 
) const [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 1147 of file ARMFrameLowering.cpp.

References llvm::RegScavenger::addScavengingFrameIndex(), llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::ARMBaseRegisterInfo::cannotEliminateFrame(), canSimplifyCallFramePseudos(), checkNumAlignedDPRCS2Regs(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SmallVectorImpl< T >::erase(), estimateRSStackSizeLimit(), llvm::SmallVectorTemplateCommon< T, typename >::front(), llvm::TargetRegisterClass::getAlignment(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::ARMBaseRegisterInfo::getBaseRegister(), llvm::ARMBaseRegisterInfo::getCalleeSavedRegs(), llvm::MachineFunction::getFrameInfo(), llvm::ARMBaseRegisterInfo::getFrameRegister(), GetFunctionSizeInBytes(), llvm::MachineFunction::getInfo(), llvm::TargetMachine::getInstrInfo(), llvm::MachineFunction::getRegInfo(), llvm::TargetMachine::getRegisterInfo(), llvm::TargetRegisterClass::getSize(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFunction::getTarget(), llvm::ARMBaseRegisterInfo::hasBasePointer(), hasFP(), llvm::ARMFunctionInfo::hasStackFrame(), llvm::isARMLowRegister(), llvm::MachineRegisterInfo::isPhysRegUsed(), llvm::MachineRegisterInfo::isReserved(), llvm::ARMSubtarget::isTargetIOS(), llvm::ARMFunctionInfo::isThumb1OnlyFunction(), llvm::ARMFunctionInfo::isThumb2Function(), llvm::ARMBaseRegisterInfo::needsStackRealignment(), llvm::SmallVectorTemplateBase< T, isPodLike >::pop_back(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::ARMFunctionInfo::setHasStackFrame(), llvm::ARMFunctionInfo::setLRIsSpilledForFarJump(), llvm::MachineRegisterInfo::setPhysRegUsed(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and STI.

int ARMFrameLowering::ResolveFrameIndexReference ( const MachineFunction MF,
int  FI,
unsigned FrameReg,
int  SPAdj 
) const
bool ARMFrameLowering::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.

Reimplemented in llvm::Thumb1FrameLowering.

Definition at line 999 of file ARMFrameLowering.cpp.

References emitAlignedDPRCS2Restores(), llvm::ARMFunctionInfo::getArgRegsSaveSize(), llvm::MachineFunction::getInfo(), llvm::ARMFunctionInfo::getNumAlignedDPRCS2Regs(), llvm::MachineBasicBlock::getParent(), llvm::isARMArea1Register(), llvm::isARMArea2Register(), llvm::isARMArea3Register(), and llvm::ARMFunctionInfo::isThumbFunction().

bool ARMFrameLowering::spillCalleeSavedRegisters ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI,
const TargetRegisterInfo TRI 
) const [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.

Reimplemented in llvm::Thumb1FrameLowering.

Definition at line 968 of file ARMFrameLowering.cpp.

References emitAlignedDPRCS2Spills(), llvm::MachineInstr::FrameSetup, llvm::MachineFunction::getInfo(), llvm::ARMFunctionInfo::getNumAlignedDPRCS2Regs(), llvm::MachineBasicBlock::getParent(), llvm::isARMArea1Register(), llvm::isARMArea2Register(), llvm::isARMArea3Register(), and llvm::ARMFunctionInfo::isThumbFunction().


Member Data Documentation


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