LLVM
8.0.1
|
Information about stack frame layout on the target. More...
#include "llvm/CodeGen/TargetFrameLowering.h"
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 SpillSlot * | getCalleeSavedSpillSlots (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 bool | enableCalleeSaveSkip (const MachineFunction &MF) const |
Returns true if the target can safely skip saving callee-saved registers for noreturn nounwind functions. 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, 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 | keepFramePointer (const MachineFunction &MF) const |
Return true if the target wants to keep the frame pointer regardless of the function attribute "frame-pointer". 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... | |
virtual int | getInitialCFAOffset (const MachineFunction &MF) const |
Return initial CFA offset value i.e. More... | |
virtual unsigned | getInitialCFARegister (const MachineFunction &MF) const |
Return initial CFA register value i.e. More... | |
Static Public Member Functions | |
static bool | isSafeForNoCSROpt (const Function &F) |
Check if given function is safe for not having callee saved registers. More... | |
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.
Enumerator | |
---|---|
StackGrowsUp | |
StackGrowsDown |
Definition at line 36 of file TargetFrameLowering.h.
|
inline |
Definition at line 53 of file TargetFrameLowering.h.
References ~TargetFrameLowering().
|
virtualdefault |
Referenced by TargetFrameLowering().
|
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 183 of file TargetFrameLowering.h.
Referenced by AssignProtectedObjSet().
|
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 178 of file TargetFrameLowering.h.
Referenced by AssignProtectedObjSet().
|
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(), llvm::RISCVFrameLowering::eliminateCallFramePseudoInstr(), and llvm::TargetInstrInfo::getSPAdjust().
|
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::PPCFrameLowering, llvm::HexagonFrameLowering, llvm::X86FrameLowering, and llvm::ARCFrameLowering.
Definition at line 121 of file TargetFrameLowering.h.
Referenced by assignCalleeSavedSpillSlots().
|
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 237 of file TargetFrameLowering.h.
References getFrameIndexReference(), hasFP(), hasReservedCallFrame(), and needsFrameIndexResolution().
|
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::PPCFrameLowering, llvm::X86FrameLowering, and llvm::Thumb1FrameLowering.
Definition at line 334 of file TargetFrameLowering.h.
Referenced by giveUpWithRemarks().
|
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 322 of file TargetFrameLowering.h.
Referenced by giveUpWithRemarks().
|
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::ARCFrameLowering, llvm::Mips16FrameLowering, llvm::MipsSEFrameLowering, llvm::SparcFrameLowering, llvm::SIFrameLowering, llvm::AVRFrameLowering, llvm::RISCVFrameLowering, llvm::BPFFrameLowering, and llvm::SystemZFrameLowering.
Definition at line 63 of file TargetFrameLoweringImpl.cpp.
References llvm::MachineFunction::callsUnwindInit(), enableCalleeSaveSkip(), 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::Attribute::Naked, llvm::Attribute::NoReturn, llvm::Attribute::NoUnwind, llvm::TargetMachine::Options, Reg, llvm::BitVector::resize(), llvm::BitVector::set(), TRI, and llvm::Attribute::UWTable.
Referenced by llvm::createRegUsageInfoCollector(), llvm::SystemZFrameLowering::determineCalleeSaves(), llvm::BPFFrameLowering::determineCalleeSaves(), llvm::RISCVFrameLowering::determineCalleeSaves(), llvm::AVRFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::determineCalleeSaves(), llvm::SparcFrameLowering::determineCalleeSaves(), llvm::ARCFrameLowering::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(), getFrameIndexReferencePreferSP(), INITIALIZE_PASS(), insertCSRRestores(), and llvm::scavengeFrameVirtualRegs().
|
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::PPCFrameLowering, llvm::X86FrameLowering, llvm::HexagonFrameLowering, llvm::ARCFrameLowering, llvm::SystemZFrameLowering, llvm::SIFrameLowering, llvm::LanaiFrameLowering, llvm::RISCVFrameLowering, llvm::XCoreFrameLowering, llvm::MipsFrameLowering, llvm::Thumb1FrameLowering, llvm::AVRFrameLowering, llvm::WebAssemblyFrameLowering, llvm::BPFFrameLowering, llvm::MSP430FrameLowering, llvm::SparcFrameLowering, llvm::NVPTXFrameLowering, and llvm::AArch64FrameLowering.
Definition at line 295 of file TargetFrameLowering.h.
References llvm_unreachable.
Referenced by AssignProtectedObjSet().
|
pure virtual |
Implemented in llvm::PPCFrameLowering, llvm::X86FrameLowering, llvm::SystemZFrameLowering, llvm::WebAssemblyFrameLowering, llvm::LanaiFrameLowering, llvm::HexagonFrameLowering, llvm::ARCFrameLowering, llvm::AArch64FrameLowering, llvm::SIFrameLowering, llvm::ARMFrameLowering, llvm::XCoreFrameLowering, llvm::MSP430FrameLowering, llvm::RISCVFrameLowering, llvm::SparcFrameLowering, llvm::MipsSEFrameLowering, llvm::BPFFrameLowering, llvm::Thumb1FrameLowering, llvm::Mips16FrameLowering, llvm::NVPTXFrameLowering, llvm::R600FrameLowering, and llvm::AVRFrameLowering.
Referenced by AssignProtectedObjSet(), llvm::createNVPTXPrologEpilogPass(), and enableStackSlotScavenging().
|
pure virtual |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Implemented in llvm::PPCFrameLowering, llvm::X86FrameLowering, llvm::SystemZFrameLowering, llvm::WebAssemblyFrameLowering, llvm::LanaiFrameLowering, llvm::HexagonFrameLowering, llvm::AArch64FrameLowering, llvm::ARCFrameLowering, llvm::ARMFrameLowering, llvm::SIFrameLowering, llvm::MSP430FrameLowering, llvm::RISCVFrameLowering, llvm::XCoreFrameLowering, llvm::SparcFrameLowering, llvm::MipsSEFrameLowering, llvm::BPFFrameLowering, llvm::Thumb1FrameLowering, llvm::Mips16FrameLowering, llvm::NVPTXFrameLowering, llvm::R600FrameLowering, and llvm::AVRFrameLowering.
Referenced by AssignProtectedObjSet(), llvm::createNVPTXPrologEpilogPass(), and enableStackSlotScavenging().
|
virtual |
Returns true if the target can safely skip saving callee-saved registers for noreturn nounwind functions.
Reimplemented in llvm::ARMFrameLowering, and llvm::HexagonFrameLowering.
Definition at line 33 of file TargetFrameLoweringImpl.cpp.
References assert(), llvm::MachineFunction::getFunction(), llvm::Function::hasFnAttribute(), llvm::Attribute::NoReturn, llvm::Attribute::NoUnwind, and llvm::Attribute::UWTable.
Referenced by determineCalleeSaves(), and enableStackSlotScavenging().
|
inlinevirtual |
Returns true if the target will correctly handle shrink wrapping.
Reimplemented in llvm::X86FrameLowering, llvm::PPCFrameLowering, llvm::AArch64FrameLowering, llvm::ARMFrameLowering, llvm::Thumb1FrameLowering, and llvm::MipsFrameLowering.
Definition at line 150 of file TargetFrameLowering.h.
Referenced by giveUpWithRemarks().
|
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(), emitPrologue(), and enableCalleeSaveSkip().
Referenced by AssignProtectedObjSet().
|
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().
|
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::SparcFrameLowering, llvm::AArch64FrameLowering, llvm::SIFrameLowering, llvm::RISCVFrameLowering, llvm::MipsSEFrameLowering, llvm::R600FrameLowering, and llvm::NVPTXFrameLowering.
Definition at line 44 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::constructLabelDIE(), llvm::createNVPTXPrologEpilogPass(), llvm::SystemZRegisterInfo::eliminateFrameIndex(), emitDebugValueComment(), llvm::SystemZFrameLowering::emitPrologue(), llvm::WinException::endFunclet(), getFrameIndexReferencePreferSP(), and INITIALIZE_PASS().
|
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, and llvm::AArch64FrameLowering.
Definition at line 258 of file TargetFrameLowering.h.
References determineCalleeSaves(), and getFrameIndexReference().
Referenced by AssignProtectedObjSet(), and llvm::WinException::endFunclet().
|
virtual |
Return initial CFA offset value i.e.
the one valid at the beginning of the function (before any stack operations).
Reimplemented in llvm::X86FrameLowering.
Definition at line 122 of file TargetFrameLoweringImpl.cpp.
References llvm_unreachable.
Referenced by INITIALIZE_PASS(), and isSafeForNoCSROpt().
|
virtual |
Return initial CFA register value i.e.
the one valid at the beginning of the function (before any stack operations).
Reimplemented in llvm::X86FrameLowering.
Definition at line 126 of file TargetFrameLoweringImpl.cpp.
References llvm_unreachable.
Referenced by INITIALIZE_PASS(), and isSafeForNoCSROpt().
|
inline |
getOffsetOfLocalArea - This method returns the offset of the local area from the stack pointer on entrance to a function.
Definition at line 107 of file TargetFrameLowering.h.
Referenced by AdjustStackOffset(), llvm::X86FrameLowering::assignCalleeSavedSpillSlots(), AssignProtectedObjSet(), llvm::AVRRegisterInfo::eliminateFrameIndex(), llvm::AArch64FrameLowering::emitCalleeSavedFrameMoves(), llvm::NVPTXFrameLowering::getFrameIndexReference(), llvm::MipsSEFrameLowering::getFrameIndexReference(), llvm::RISCVFrameLowering::getFrameIndexReference(), llvm::X86FrameLowering::getFrameIndexReference(), getFrameIndexReference(), llvm::X86FrameLowering::getFrameIndexReferenceSP(), and llvm::MachineFrameInfo::print().
|
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(), llvm::AArch64FrameLowering::eliminateCallFramePseudoInstr(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::Thumb1FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::SparcFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), EnsureStackAlignment(), llvm::MachineFrameInfo::estimateStackSize(), getFnStackAlignment(), getMOVL(), llvm::X86InstrInfo::getSPAdjust(), llvm::AArch64FrameLowering::getWinEHFuncletFrameSize(), llvm::MipsTargetLowering::HandleByVal(), llvm::RISCVFrameLowering::hasFP(), hasOnlySelectUsers(), llvm::MipsSEFrameLowering::hasReservedCallFrame(), isFuncletReturnInstr(), llvm::HexagonInstrInfo::loadRegFromStackSlot(), LowerADJUST_TRAMPOLINE(), llvm::MipsCallLowering::lowerCall(), LowerDYNAMIC_STACKALLOC(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::ARMBaseRegisterInfo::needsFrameBaseReg(), llvm::TargetRegisterInfo::needsStackRealignment(), llvm::HexagonDAGToDAGISel::SelectFrameIndex(), llvm::FunctionLoweringInfo::set(), and llvm::HexagonInstrInfo::storeRegToStackSlot().
|
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 112 of file TargetFrameLoweringImpl.cpp.
References llvm::TargetMachine::getAllocaPointerSize(), llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getTarget(), llvm::CallingConv::HHVM, and LLVM_UNLIKELY.
Referenced by AssignProtectedObjSet(), and isStackRealignable().
|
inline |
getStackGrowthDirection - Return the direction the stack grows
Definition at line 65 of file TargetFrameLowering.h.
Referenced by AdjustStackOffset(), AssignProtectedObjSet(), llvm::TargetInstrInfo::getSPAdjust(), INITIALIZE_PASS(), lookupCandidateBaseReg(), and llvm::ScheduleDAGMILive::scheduleMI().
|
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().
|
inlinevirtual |
Reimplemented in llvm::X86FrameLowering, and llvm::AArch64FrameLowering.
Definition at line 284 of file TargetFrameLowering.h.
References llvm::report_fatal_error().
|
pure 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.
Implemented in llvm::X86FrameLowering, llvm::PPCFrameLowering, llvm::HexagonFrameLowering, llvm::SIFrameLowering, llvm::AArch64FrameLowering, llvm::ARCFrameLowering, llvm::ARMFrameLowering, llvm::LanaiFrameLowering, llvm::XCoreFrameLowering, llvm::MSP430FrameLowering, llvm::WebAssemblyFrameLowering, llvm::SystemZFrameLowering, llvm::RISCVFrameLowering, llvm::SparcFrameLowering, llvm::MipsFrameLowering, llvm::R600FrameLowering, llvm::BPFFrameLowering, llvm::AVRFrameLowering, and llvm::NVPTXFrameLowering.
Referenced by addExclusiveRegPair(), AssignProtectedObjSet(), llvm::CodeViewDebug::beginFunctionImpl(), canSimplifyCallFramePseudos(), createPHIsForSelects(), llvm::LanaiRegisterInfo::eliminateFrameIndex(), estimateRSStackSizeLimit(), llvm::RISCVRegisterInfo::getFrameRegister(), llvm::AVRRegisterInfo::getFrameRegister(), llvm::X86TargetLowering::getRegisterByName(), llvm::MipsRegisterInfo::getRegPressureLimit(), llvm::MipsRegisterInfo::getReservedRegs(), hasReservedCallFrame(), llvm::Mips16RegisterInfo::intRegClass(), and keepFramePointer().
|
inlinevirtual |
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 in llvm::X86FrameLowering, llvm::AArch64FrameLowering, llvm::HexagonFrameLowering, llvm::ARMFrameLowering, llvm::MSP430FrameLowering, llvm::WebAssemblyFrameLowering, llvm::SystemZFrameLowering, llvm::RISCVFrameLowering, llvm::Mips16FrameLowering, llvm::MipsSEFrameLowering, llvm::Thumb1FrameLowering, llvm::SparcFrameLowering, and llvm::AVRFrameLowering.
Definition at line 226 of file TargetFrameLowering.h.
References hasFP().
Referenced by AdjustStackOffset(), AssignProtectedObjSet(), llvm::MipsRegisterInfo::canRealignStack(), canSimplifyCallFramePseudos(), llvm::AArch64FrameLowering::eliminateCallFramePseudoInstr(), llvm::MipsFrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::MachineFrameInfo::estimateStackSize(), and llvm::X86FrameLowering::getFrameIndexReferencePreferSP().
|
inlinevirtual |
Replace a StackProbe stub (if any) with the actual probe code inline.
Reimplemented in llvm::X86FrameLowering.
Definition at line 173 of file TargetFrameLowering.h.
Referenced by AssignProtectedObjSet().
|
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().
Check if given function is safe for not having callee saved registers.
This is used when interprocedural register allocation is enabled.
Definition at line 340 of file TargetFrameLowering.h.
References getInitialCFAOffset(), getInitialCFARegister(), llvm::Function::hasAddressTaken(), llvm::Function::hasFnAttribute(), llvm::GlobalValue::hasLocalLinkage(), llvm::Attribute::NoRecurse, and llvm::Value::users().
Referenced by llvm::createRegUsageInfoCollector(), and determineCalleeSaves().
|
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().
|
inlinevirtual |
Return true if the target wants to keep the frame pointer regardless of the function attribute "frame-pointer".
Reimplemented in llvm::ARMFrameLowering.
Definition at line 212 of file TargetFrameLowering.h.
References hasFP().
Referenced by llvm::TargetOptions::DisableFramePointerElim().
|
virtual |
Reimplemented in llvm::X86FrameLowering.
Definition at line 58 of file TargetFrameLoweringImpl.cpp.
References llvm::MachineFunction::getFrameInfo(), and llvm::MachineFrameInfo::hasStackObjects().
Referenced by AssignProtectedObjSet(), and canSimplifyCallFramePseudos().
|
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 310 of file TargetFrameLowering.h.
Referenced by AssignProtectedObjSet().
|
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::AArch64FrameLowering, llvm::HexagonFrameLowering, llvm::ARCFrameLowering, llvm::XCoreFrameLowering, llvm::MSP430FrameLowering, llvm::SIFrameLowering, llvm::SystemZFrameLowering, and llvm::RISCVFrameLowering.
Definition at line 280 of file TargetFrameLowering.h.
Referenced by llvm::scavengeFrameVirtualRegs().
|
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().
If it returns true, and any of the registers in CSI is not restored, it sets the corresponding Restored flag in CSI to false. Returns false otherwise.
Reimplemented in llvm::PPCFrameLowering, llvm::X86FrameLowering, llvm::HexagonFrameLowering, llvm::AArch64FrameLowering, llvm::ARCFrameLowering, llvm::MSP430FrameLowering, llvm::ARMFrameLowering, llvm::XCoreFrameLowering, llvm::SystemZFrameLowering, llvm::Mips16FrameLowering, llvm::Thumb1FrameLowering, and llvm::AVRFrameLowering.
Definition at line 203 of file TargetFrameLowering.h.
Referenced by insertCSRRestores().
|
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::ARCFrameLowering, llvm::MSP430FrameLowering, llvm::ARMFrameLowering, llvm::XCoreFrameLowering, llvm::MipsSEFrameLowering, llvm::SystemZFrameLowering, llvm::Thumb1FrameLowering, llvm::Mips16FrameLowering, and llvm::AVRFrameLowering.
Definition at line 190 of file TargetFrameLowering.h.
Referenced by insertCSRSaves().
|
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().