LLVM  6.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::TargetFrameLowering Class Referenceabstract

Information about stack frame layout on the target. More...

#include "llvm/Target/TargetFrameLowering.h"

Inheritance diagram for llvm::TargetFrameLowering:
Inheritance graph
[legend]

Classes

struct  SpillSlot
 

Public Types

enum  StackDirection { StackGrowsUp, StackGrowsDown }
 

Public Member Functions

 TargetFrameLowering (StackDirection D, unsigned StackAl, int LAO, unsigned TransAl=1, bool StackReal=true)
 
virtual ~TargetFrameLowering ()
 
StackDirection getStackGrowthDirection () const
 getStackGrowthDirection - Return the direction the stack grows More...
 
unsigned getStackAlignment () const
 getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligned on entry to a function. More...
 
int alignSPAdjust (int SPAdj) const
 alignSPAdjust - This method aligns the stack adjustment to the correct alignment. More...
 
unsigned getTransientStackAlignment () const
 getTransientStackAlignment - This method returns the number of bytes to which the stack pointer must be aligned at all times, even between calls. More...
 
bool isStackRealignable () const
 isStackRealignable - This method returns whether the stack can be realigned. More...
 
virtual unsigned getStackAlignmentSkew (const MachineFunction &MF) const
 Return the skew that has to be applied to stack alignment under certain conditions (e.g. More...
 
int getOffsetOfLocalArea () const
 getOffsetOfLocalArea - This method returns the offset of the local area from the stack pointer on entrance to a function. More...
 
virtual bool isFPCloseToIncomingSP () const
 isFPCloseToIncomingSP - Return true if the frame pointer is close to the incoming stack pointer, false if it is close to the post-prologue stack pointer. More...
 
virtual bool assignCalleeSavedSpillSlots (MachineFunction &MF, const TargetRegisterInfo *TRI, std::vector< CalleeSavedInfo > &CSI) const
 assignCalleeSavedSpillSlots - Allows target to override spill slot assignment logic. More...
 
virtual const SpillSlotgetCalleeSavedSpillSlots (unsigned &NumEntries) const
 getCalleeSavedSpillSlots - This method returns a pointer to an array of pairs, that contains an entry for each callee saved register that must be spilled to a particular stack location if it is spilled. More...
 
virtual bool targetHandlesStackFrameRounding () const
 targetHandlesStackFrameRounding - Returns true if the target is responsible for rounding up the stack frame (probably at emitPrologue time). More...
 
virtual bool enableShrinkWrapping (const MachineFunction &MF) const
 Returns true if the target will correctly handle shrink wrapping. More...
 
virtual bool enableStackSlotScavenging (const MachineFunction &MF) const
 Returns true if the stack slot holes in the fixed and callee-save stack area should be used when allocating other stack locations to reduce stack size. More...
 
virtual void emitPrologue (MachineFunction &MF, MachineBasicBlock &MBB) const =0
 emitProlog/emitEpilog - These methods insert prolog and epilog code into the function. More...
 
virtual void emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) const =0
 
virtual void inlineStackProbe (MachineFunction &MF, MachineBasicBlock &PrologueMBB) const
 Replace a StackProbe stub (if any) with the actual probe code inline. More...
 
virtual void adjustForSegmentedStacks (MachineFunction &MF, MachineBasicBlock &PrologueMBB) const
 Adjust the prologue to have the function use segmented stacks. More...
 
virtual void adjustForHiPEPrologue (MachineFunction &MF, MachineBasicBlock &PrologueMBB) const
 Adjust the prologue to add Erlang Run-Time System (ERTS) specific code in the assembly prologue to explicitly handle the stack. More...
 
virtual bool spillCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const
 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(). More...
 
virtual bool restoreCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const
 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(). More...
 
virtual bool noFramePointerElim (const MachineFunction &MF) const
 Return true if the target needs to disable frame pointer elimination. More...
 
virtual bool hasFP (const MachineFunction &MF) const =0
 hasFP - Return true if the specified function should have a dedicated frame pointer register. More...
 
virtual bool hasReservedCallFrame (const MachineFunction &MF) const
 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. More...
 
virtual bool canSimplifyCallFramePseudos (const MachineFunction &MF) const
 canSimplifyCallFramePseudos - When possible, it's best to simplify the call frame pseudo ops before doing frame index elimination. More...
 
virtual bool needsFrameIndexResolution (const MachineFunction &MF) const
 
virtual int getFrameIndexReference (const MachineFunction &MF, int FI, unsigned &FrameReg) const
 getFrameIndexReference - This method should return the base register and offset used to reference a frame index location. More...
 
virtual int getFrameIndexReferencePreferSP (const MachineFunction &MF, int FI, unsigned &FrameReg, bool IgnoreSPUpdates) const
 Same as getFrameIndexReference, except that the stack pointer (as opposed to the frame pointer) will be the preferred value for FrameReg. More...
 
virtual void determineCalleeSaves (MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const
 This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() should actually get saved. More...
 
virtual void processFunctionBeforeFrameFinalized (MachineFunction &MF, RegScavenger *RS=nullptr) const
 processFunctionBeforeFrameFinalized - This method is called immediately before the specified function's frame layout (MF.getFrameInfo()) is finalized. More...
 
virtual unsigned getWinEHParentFrameOffset (const MachineFunction &MF) const
 
virtual MachineBasicBlock::iterator eliminateCallFramePseudoInstr (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const
 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). More...
 
virtual void orderFrameObjects (const MachineFunction &MF, SmallVectorImpl< int > &objectsToAllocate) const
 Order the symbols in the local stack frame. More...
 
virtual bool canUseAsPrologue (const MachineBasicBlock &MBB) const
 Check whether or not the given MBB can be used as a prologue for the target. More...
 
virtual bool canUseAsEpilogue (const MachineBasicBlock &MBB) const
 Check whether or not the given MBB can be used as a epilogue for the target. More...
 

Static Public Member Functions

static bool isSafeForNoCSROpt (const Function *F)
 Check if given function is safe for not having callee saved registers. More...
 

Detailed Description

Information about stack frame layout on the target.

It holds the direction of stack growth, the known stack alignment on entry to each function, and the offset to the locals area.

The offset to the local area is the offset from the stack pointer on function entry to the first location where function data (local variables, spill locations) can be stored.

Definition at line 34 of file TargetFrameLowering.h.

Member Enumeration Documentation

◆ StackDirection

Enumerator
StackGrowsUp 
StackGrowsDown 

Definition at line 36 of file TargetFrameLowering.h.

Constructor & Destructor Documentation

◆ TargetFrameLowering()

llvm::TargetFrameLowering::TargetFrameLowering ( StackDirection  D,
unsigned  StackAl,
int  LAO,
unsigned  TransAl = 1,
bool  StackReal = true 
)
inline

Definition at line 53 of file TargetFrameLowering.h.

References ~TargetFrameLowering().

◆ ~TargetFrameLowering()

TargetFrameLowering::~TargetFrameLowering ( )
virtualdefault

Referenced by TargetFrameLowering().

Member Function Documentation

◆ adjustForHiPEPrologue()

virtual void llvm::TargetFrameLowering::adjustForHiPEPrologue ( MachineFunction MF,
MachineBasicBlock PrologueMBB 
) const
inlinevirtual

Adjust the prologue to add Erlang Run-Time System (ERTS) specific code in the assembly prologue to explicitly handle the stack.

Reimplemented in llvm::X86FrameLowering.

Definition at line 179 of file TargetFrameLowering.h.

Referenced by AssignProtectedObjSet().

◆ adjustForSegmentedStacks()

virtual void llvm::TargetFrameLowering::adjustForSegmentedStacks ( MachineFunction MF,
MachineBasicBlock PrologueMBB 
) const
inlinevirtual

Adjust the prologue to have the function use segmented stacks.

This works by adding a check even before the "normal" function prologue.

Reimplemented in llvm::X86FrameLowering, and llvm::ARMFrameLowering.

Definition at line 174 of file TargetFrameLowering.h.

Referenced by AssignProtectedObjSet().

◆ alignSPAdjust()

int llvm::TargetFrameLowering::alignSPAdjust ( int  SPAdj) const
inline

alignSPAdjust - This method aligns the stack adjustment to the correct alignment.

Definition at line 76 of file TargetFrameLowering.h.

References llvm::alignTo().

Referenced by llvm::ARMFrameLowering::determineCalleeSaves(), and llvm::TargetInstrInfo::getSPAdjust().

◆ assignCalleeSavedSpillSlots()

virtual bool llvm::TargetFrameLowering::assignCalleeSavedSpillSlots ( MachineFunction MF,
const TargetRegisterInfo TRI,
std::vector< CalleeSavedInfo > &  CSI 
) const
inlinevirtual

assignCalleeSavedSpillSlots - Allows target to override spill slot assignment logic.

If implemented, assignCalleeSavedSpillSlots() should assign frame slots to all CSI entries and return true. If this method returns false, spill slots will be assigned using generic implementation. assignCalleeSavedSpillSlots() may add, delete or rearrange elements of CSI.

Reimplemented in llvm::HexagonFrameLowering, and llvm::X86FrameLowering.

Definition at line 121 of file TargetFrameLowering.h.

Referenced by assignCalleeSavedSpillSlots().

◆ canSimplifyCallFramePseudos()

virtual bool llvm::TargetFrameLowering::canSimplifyCallFramePseudos ( const MachineFunction MF) const
inlinevirtual

canSimplifyCallFramePseudos - When possible, it's best to simplify the call frame pseudo ops before doing frame index elimination.

This is possible only when frame index references between the pseudos won't need adjusting for the call frame adjustments. Normally, that's true if the function has a reserved call frame or a frame pointer. Some targets (Thumb2, for example) may have more complicated criteria, however, and can override this behavior.

Reimplemented in llvm::X86FrameLowering, llvm::HexagonFrameLowering, llvm::ARMFrameLowering, and llvm::AVRFrameLowering.

Definition at line 228 of file TargetFrameLowering.h.

References getFrameIndexReference(), hasFP(), hasReservedCallFrame(), and needsFrameIndexResolution().

◆ canUseAsEpilogue()

virtual bool llvm::TargetFrameLowering::canUseAsEpilogue ( const MachineBasicBlock MBB) const
inlinevirtual

Check whether or not the given MBB can be used as a epilogue for the target.

The epilogue will be inserted before the first terminator of that block. This method is used by the shrink-wrapping pass to decide if MBB will be correctly handled by the target. As soon as the target enable shrink-wrapping without overriding this method, we assume that each basic block is a valid epilogue.

Reimplemented in llvm::X86FrameLowering, llvm::PPCFrameLowering, and llvm::Thumb1FrameLowering.

Definition at line 325 of file TargetFrameLowering.h.

Referenced by isIrreducibleCFG().

◆ canUseAsPrologue()

virtual bool llvm::TargetFrameLowering::canUseAsPrologue ( const MachineBasicBlock MBB) const
inlinevirtual

Check whether or not the given MBB can be used as a prologue for the target.

The prologue will be inserted first in this basic block. This method is used by the shrink-wrapping pass to decide if MBB will be correctly handled by the target. As soon as the target enable shrink-wrapping without overriding this method, we assume that each basic block is a valid prologue.

Reimplemented in llvm::PPCFrameLowering, llvm::X86FrameLowering, and llvm::AArch64FrameLowering.

Definition at line 313 of file TargetFrameLowering.h.

Referenced by isIrreducibleCFG().

◆ determineCalleeSaves()

void TargetFrameLowering::determineCalleeSaves ( MachineFunction MF,
BitVector SavedRegs,
RegScavenger RS = nullptr 
) const
virtual

This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() should actually get saved.

The default implementation checks populates the SavedRegs bitset with all registers which are modified in the function, targets may override this function to save additional registers. This method also sets up the register scavenger ensuring there is a free register or a frameindex available.

Reimplemented in llvm::PPCFrameLowering, llvm::X86FrameLowering, llvm::HexagonFrameLowering, llvm::AArch64FrameLowering, llvm::ARMFrameLowering, llvm::LanaiFrameLowering, llvm::XCoreFrameLowering, llvm::MipsSEFrameLowering, llvm::Mips16FrameLowering, llvm::SparcFrameLowering, llvm::AVRFrameLowering, llvm::BPFFrameLowering, and llvm::SystemZFrameLowering.

Definition at line 62 of file TargetFrameLoweringImpl.cpp.

References llvm::MachineFunction::callsUnwindInit(), llvm::TargetOptions::EnableIPRA, llvm::MachineRegisterInfo::getCalleeSavedRegs(), llvm::MachineFunction::getFunction(), llvm::MCRegisterInfo::getNumRegs(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::Function::hasFnAttribute(), llvm::MachineRegisterInfo::isPhysRegModified(), isSafeForNoCSROpt(), MRI, llvm::TargetMachine::Options, llvm::BitVector::resize(), and llvm::BitVector::set().

Referenced by llvm::SystemZFrameLowering::determineCalleeSaves(), llvm::BPFFrameLowering::determineCalleeSaves(), llvm::AVRFrameLowering::determineCalleeSaves(), llvm::SparcFrameLowering::determineCalleeSaves(), llvm::Mips16FrameLowering::determineCalleeSaves(), llvm::MipsSEFrameLowering::determineCalleeSaves(), llvm::XCoreFrameLowering::determineCalleeSaves(), llvm::LanaiFrameLowering::determineCalleeSaves(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::HexagonFrameLowering::determineCalleeSaves(), llvm::X86FrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineCalleeSaves(), doSpillCalleeSavedRegs(), getFrameIndexReferencePreferSP(), and llvm::scavengeFrameVirtualRegs().

◆ eliminateCallFramePseudoInstr()

virtual MachineBasicBlock::iterator llvm::TargetFrameLowering::eliminateCallFramePseudoInstr ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI 
) const
inlinevirtual

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. Returns an iterator pointing to the instruction after the replaced one.

Reimplemented in llvm::X86FrameLowering, llvm::PPCFrameLowering, llvm::HexagonFrameLowering, llvm::SystemZFrameLowering, llvm::LanaiFrameLowering, llvm::Thumb1FrameLowering, llvm::XCoreFrameLowering, llvm::AVRFrameLowering, llvm::MipsFrameLowering, llvm::WebAssemblyFrameLowering, llvm::BPFFrameLowering, llvm::MSP430FrameLowering, llvm::SparcFrameLowering, llvm::AArch64FrameLowering, and llvm::NVPTXFrameLowering.

Definition at line 286 of file TargetFrameLowering.h.

References llvm_unreachable.

Referenced by AssignProtectedObjSet().

◆ emitEpilogue()

virtual void llvm::TargetFrameLowering::emitEpilogue ( MachineFunction MF,
MachineBasicBlock MBB 
) const
pure virtual

◆ emitPrologue()

virtual void llvm::TargetFrameLowering::emitPrologue ( MachineFunction MF,
MachineBasicBlock MBB 
) const
pure virtual

◆ enableShrinkWrapping()

virtual bool llvm::TargetFrameLowering::enableShrinkWrapping ( const MachineFunction MF) const
inlinevirtual

Returns true if the target will correctly handle shrink wrapping.

Reimplemented in llvm::X86FrameLowering, llvm::PPCFrameLowering, llvm::AArch64FrameLowering, llvm::ARMFrameLowering, and llvm::Thumb1FrameLowering.

Definition at line 150 of file TargetFrameLowering.h.

Referenced by isIrreducibleCFG().

◆ enableStackSlotScavenging()

virtual bool llvm::TargetFrameLowering::enableStackSlotScavenging ( const MachineFunction MF) const
inlinevirtual

Returns true if the stack slot holes in the fixed and callee-save stack area should be used when allocating other stack locations to reduce stack size.

Reimplemented in llvm::AArch64FrameLowering.

Definition at line 157 of file TargetFrameLowering.h.

References emitEpilogue(), and emitPrologue().

Referenced by AssignProtectedObjSet().

◆ getCalleeSavedSpillSlots()

virtual const SpillSlot* llvm::TargetFrameLowering::getCalleeSavedSpillSlots ( unsigned NumEntries) const
inlinevirtual

getCalleeSavedSpillSlots - This method returns a pointer to an array of pairs, that contains an entry for each callee saved register that must be spilled to a particular stack location if it is spilled.

Each entry in this array contains a <register,offset> pair, indicating the fixed offset from the incoming stack pointer that each register should be spilled at. If a register is not listed here, the code generator is allowed to spill it anywhere it chooses.

Reimplemented in llvm::PPCFrameLowering, llvm::HexagonFrameLowering, and llvm::SystemZFrameLowering.

Definition at line 137 of file TargetFrameLowering.h.

Referenced by assignCalleeSavedSpillSlots().

◆ getFrameIndexReference()

int TargetFrameLowering::getFrameIndexReference ( const MachineFunction MF,
int  FI,
unsigned FrameReg 
) const
virtual

getFrameIndexReference - This method should return the base register and offset used to reference a frame index location.

Returns the displacement from the frame register to the stack frame of the specified index, along with the frame register used (in output arg FrameReg).

The offset is returned directly, and the base register is returned via FrameReg.

This is the default implementation which is overridden for some targets.

Reimplemented in llvm::X86FrameLowering, llvm::HexagonFrameLowering, llvm::ARMFrameLowering, llvm::SystemZFrameLowering, llvm::SparcFrameLowering, llvm::AArch64FrameLowering, llvm::SIFrameLowering, llvm::MipsSEFrameLowering, and llvm::R600FrameLowering.

Definition at line 43 of file TargetFrameLoweringImpl.cpp.

References llvm::MachineFunction::getFrameInfo(), llvm::TargetRegisterInfo::getFrameRegister(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineFrameInfo::getOffsetAdjustment(), getOffsetOfLocalArea(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFrameInfo::getStackSize(), and llvm::MachineFunction::getSubtarget().

Referenced by AssignProtectedObjSet(), canSimplifyCallFramePseudos(), llvm::DwarfCompileUnit::constructVariableDIE(), emitDebugValueComment(), emitNullTerminatedSymbolName(), llvm::WinException::endFunclet(), getFrameIndexReferencePreferSP(), and INITIALIZE_PASS().

◆ getFrameIndexReferencePreferSP()

virtual int llvm::TargetFrameLowering::getFrameIndexReferencePreferSP ( const MachineFunction MF,
int  FI,
unsigned FrameReg,
bool  IgnoreSPUpdates 
) const
inlinevirtual

Same as getFrameIndexReference, except that the stack pointer (as opposed to the frame pointer) will be the preferred value for FrameReg.

This is generally used for emitting statepoint or EH tables that use offsets from RSP. If IgnoreSPUpdates is true, the returned offset is only guaranteed to be valid with respect to the value of SP at the end of the prologue.

Reimplemented in llvm::X86FrameLowering.

Definition at line 249 of file TargetFrameLowering.h.

References determineCalleeSaves(), and getFrameIndexReference().

Referenced by AssignProtectedObjSet(), and llvm::WinException::endFunclet().

◆ getOffsetOfLocalArea()

int llvm::TargetFrameLowering::getOffsetOfLocalArea ( ) const
inline

◆ getStackAlignment()

unsigned llvm::TargetFrameLowering::getStackAlignment ( ) const
inline

getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligned on entry to a function.

Typically, this is the largest alignment for any data object in the target.

Definition at line 71 of file TargetFrameLowering.h.

Referenced by llvm::PPCFrameLowering::addScavengingSpillSlot(), AdjustStackOffset(), assignCalleeSavedSpillSlots(), AssignProtectedObjSet(), calculateSetFPREG(), checkNumAlignedDPRCS2Regs(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineFrameLayout(), doesIntrinsicReturnPredicate(), llvm::AArch64FrameLowering::eliminateCallFramePseudoInstr(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::Thumb1FrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::SparcFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), EnsureStackAlignment(), llvm::MipsFrameLowering::estimateStackSize(), llvm::MachineFrameInfo::estimateStackSize(), getAbsolute(), llvm::IRTranslator::getAnalysisUsage(), getFnStackAlignment(), getMOVL(), llvm::MipsTargetLowering::getOpndList(), llvm::X86InstrInfo::getSPAdjust(), llvm::MipsTargetLowering::HandleByVal(), hasOnlySelectUsers(), llvm::MipsSEFrameLowering::hasReservedCallFrame(), isFuncletReturnInstr(), isXor1OfSetCC(), LowerADJUST_TRAMPOLINE(), LowerDYNAMIC_STACKALLOC(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::ARMBaseRegisterInfo::needsFrameBaseReg(), llvm::TargetRegisterInfo::needsStackRealignment(), and llvm::FunctionLoweringInfo::set().

◆ getStackAlignmentSkew()

unsigned TargetFrameLowering::getStackAlignmentSkew ( const MachineFunction MF) const
virtual

Return the skew that has to be applied to stack alignment under certain conditions (e.g.

stack was adjusted before function MF was called).

Definition at line 98 of file TargetFrameLoweringImpl.cpp.

References llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::TargetMachine::getPointerSize(), llvm::MachineFunction::getTarget(), llvm::CallingConv::HHVM, and LLVM_UNLIKELY.

Referenced by AssignProtectedObjSet(), and isStackRealignable().

◆ getStackGrowthDirection()

StackDirection llvm::TargetFrameLowering::getStackGrowthDirection ( ) const
inline

getStackGrowthDirection - Return the direction the stack grows

Definition at line 65 of file TargetFrameLowering.h.

Referenced by AdjustStackOffset(), AssignProtectedObjSet(), llvm::TargetInstrInfo::getSPAdjust(), and lookupCandidateBaseReg().

◆ getTransientStackAlignment()

unsigned llvm::TargetFrameLowering::getTransientStackAlignment ( ) const
inline

getTransientStackAlignment - This method returns the number of bytes to which the stack pointer must be aligned at all times, even between calls.

Definition at line 89 of file TargetFrameLowering.h.

Referenced by AdjustStackOffset(), AssignProtectedObjSet(), llvm::MachineFrameInfo::estimateStackSize(), and mayCombineMisaligned().

◆ getWinEHParentFrameOffset()

virtual unsigned llvm::TargetFrameLowering::getWinEHParentFrameOffset ( const MachineFunction MF) const
inlinevirtual

Reimplemented in llvm::X86FrameLowering.

Definition at line 275 of file TargetFrameLowering.h.

References llvm::report_fatal_error().

Referenced by llvm::WinException::endFunclet().

◆ hasFP()

virtual bool llvm::TargetFrameLowering::hasFP ( const MachineFunction MF) const
pure virtual

◆ hasReservedCallFrame()

virtual bool llvm::TargetFrameLowering::hasReservedCallFrame ( const MachineFunction MF) const
inlinevirtual

◆ inlineStackProbe()

virtual void llvm::TargetFrameLowering::inlineStackProbe ( MachineFunction MF,
MachineBasicBlock PrologueMBB 
) const
inlinevirtual

Replace a StackProbe stub (if any) with the actual probe code inline.

Reimplemented in llvm::X86FrameLowering.

Definition at line 169 of file TargetFrameLowering.h.

Referenced by AssignProtectedObjSet().

◆ isFPCloseToIncomingSP()

virtual bool llvm::TargetFrameLowering::isFPCloseToIncomingSP ( ) const
inlinevirtual

isFPCloseToIncomingSP - Return true if the frame pointer is close to the incoming stack pointer, false if it is close to the post-prologue stack pointer.

Reimplemented in llvm::MipsFrameLowering, and llvm::SystemZFrameLowering.

Definition at line 112 of file TargetFrameLowering.h.

Referenced by AssignProtectedObjSet().

◆ isSafeForNoCSROpt()

static bool llvm::TargetFrameLowering::isSafeForNoCSROpt ( const Function F)
inlinestatic

Check if given function is safe for not having callee saved registers.

This is used when interprocedural register allocation is enabled.

Definition at line 331 of file TargetFrameLowering.h.

References llvm::Function::hasAddressTaken(), llvm::Function::hasFnAttribute(), llvm::GlobalValue::hasLocalLinkage(), and llvm::Value::users().

Referenced by llvm::createRegUsageInfoCollector(), and determineCalleeSaves().

◆ isStackRealignable()

bool llvm::TargetFrameLowering::isStackRealignable ( ) const
inline

isStackRealignable - This method returns whether the stack can be realigned.

Definition at line 95 of file TargetFrameLowering.h.

References getStackAlignmentSkew().

Referenced by llvm::MachineFunction::MachineFunction(), and llvm::FunctionLoweringInfo::set().

◆ needsFrameIndexResolution()

bool TargetFrameLowering::needsFrameIndexResolution ( const MachineFunction MF) const
virtual

◆ noFramePointerElim()

bool TargetFrameLowering::noFramePointerElim ( const MachineFunction MF) const
virtual

Return true if the target needs to disable frame pointer elimination.

The default implementation just looks at attribute "no-frame-pointer-elim".

Reimplemented in llvm::ARMFrameLowering.

Definition at line 34 of file TargetFrameLoweringImpl.cpp.

References llvm::Function::getFnAttribute(), llvm::MachineFunction::getFunction(), and llvm::Attribute::getValueAsString().

Referenced by llvm::TargetOptions::DisableFramePointerElim(), llvm::ARMFrameLowering::noFramePointerElim(), and restoreCalleeSavedRegisters().

◆ orderFrameObjects()

virtual void llvm::TargetFrameLowering::orderFrameObjects ( const MachineFunction MF,
SmallVectorImpl< int > &  objectsToAllocate 
) const
inlinevirtual

Order the symbols in the local stack frame.

The list of objects that we want to order is in objectsToAllocate as indices into the MachineFrameInfo. The array can be reordered in any way upon return. The contents of the array, however, may not be modified (i.e. only their order may be changed). By default, just maintain the original order.

Reimplemented in llvm::X86FrameLowering.

Definition at line 301 of file TargetFrameLowering.h.

Referenced by AssignProtectedObjSet().

◆ processFunctionBeforeFrameFinalized()

virtual void llvm::TargetFrameLowering::processFunctionBeforeFrameFinalized ( MachineFunction MF,
RegScavenger RS = nullptr 
) const
inlinevirtual

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 in llvm::X86FrameLowering, llvm::PPCFrameLowering, llvm::HexagonFrameLowering, llvm::XCoreFrameLowering, llvm::MSP430FrameLowering, llvm::SystemZFrameLowering, and llvm::SIFrameLowering.

Definition at line 271 of file TargetFrameLowering.h.

Referenced by llvm::scavengeFrameVirtualRegs().

◆ restoreCalleeSavedRegisters()

virtual bool llvm::TargetFrameLowering::restoreCalleeSavedRegisters ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI,
const TargetRegisterInfo TRI 
) const
inlinevirtual

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 in llvm::PPCFrameLowering, llvm::X86FrameLowering, llvm::AArch64FrameLowering, llvm::HexagonFrameLowering, llvm::MSP430FrameLowering, llvm::ARMFrameLowering, llvm::XCoreFrameLowering, llvm::Thumb1FrameLowering, llvm::SystemZFrameLowering, llvm::Mips16FrameLowering, and llvm::AVRFrameLowering.

Definition at line 197 of file TargetFrameLowering.h.

References hasFP(), and noFramePointerElim().

Referenced by insertCSRRestores().

◆ spillCalleeSavedRegisters()

virtual bool llvm::TargetFrameLowering::spillCalleeSavedRegisters ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI,
const TargetRegisterInfo TRI 
) const
inlinevirtual

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 in llvm::PPCFrameLowering, llvm::X86FrameLowering, llvm::AArch64FrameLowering, llvm::HexagonFrameLowering, llvm::MSP430FrameLowering, llvm::MipsSEFrameLowering, llvm::XCoreFrameLowering, llvm::ARMFrameLowering, llvm::Thumb1FrameLowering, llvm::SystemZFrameLowering, llvm::Mips16FrameLowering, and llvm::AVRFrameLowering.

Definition at line 186 of file TargetFrameLowering.h.

Referenced by insertCSRSaves().

◆ targetHandlesStackFrameRounding()

virtual bool llvm::TargetFrameLowering::targetHandlesStackFrameRounding ( ) const
inlinevirtual

targetHandlesStackFrameRounding - Returns true if the target is responsible for rounding up the stack frame (probably at emitPrologue time).

Reimplemented in llvm::PPCFrameLowering, llvm::HexagonFrameLowering, and llvm::SparcFrameLowering.

Definition at line 145 of file TargetFrameLowering.h.

Referenced by AdjustStackOffset(), and AssignProtectedObjSet().


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