|
LLVM
10.0.0
|
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, Align StackAl, int LAO, Align TransAl=Align::None(), 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 int | getNonLocalFrameIndexReference (const MachineFunction &MF, int FI) const |
| getNonLocalFrameIndexReference - This method returns the offset used to reference a frame index location. More... | |
| virtual void | getCalleeSaves (const MachineFunction &MF, BitVector &SavedRegs) const |
Returns the callee-saved registers as computed by determineCalleeSaves in the BitVector SavedRegs. 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 TargetStackID::Value | getStackIDForScalableVectors () const |
| Returns the StackID that scalable vectors should be associated with. More... | |
| virtual bool | isSupportedStackID (TargetStackID::Value ID) const |
| virtual bool | isProfitableForNoCSROpt (const Function &F) const |
| Check if the no-CSR optimisation is profitable for the given function. 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 43 of file TargetFrameLowering.h.
| Enumerator | |
|---|---|
| StackGrowsUp | |
| StackGrowsDown | |
Definition at line 45 of file TargetFrameLowering.h.
|
inline |
Definition at line 62 of file TargetFrameLowering.h.
|
virtualdefault |
|
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 192 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 187 of file TargetFrameLowering.h.
Referenced by AssignProtectedObjSet().
|
inline |
alignSPAdjust - This method aligns the stack adjustment to the correct alignment.
Definition at line 85 of file TargetFrameLowering.h.
References llvm::alignTo().
Referenced by llvm::RISCVFrameLowering::eliminateCallFramePseudoInstr(), llvm::ARMFrameLowering::getCalleeSaves(), 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, llvm::ARCFrameLowering, llvm::SIFrameLowering, and llvm::SystemZFrameLowering.
Definition at line 130 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 246 of file TargetFrameLowering.h.
Referenced by stashEntryDbgValues().
|
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 362 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 350 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. This method should not be called by any passes outside of PEI, because it may change state passed in by MF and RS. The preferred interface outside PEI is getCalleeSaves.
Reimplemented in llvm::PPCFrameLowering, llvm::X86FrameLowering, llvm::HexagonFrameLowering, llvm::AArch64FrameLowering, llvm::ARMFrameLowering, llvm::LanaiFrameLowering, llvm::XCoreFrameLowering, llvm::VEFrameLowering, llvm::ARCFrameLowering, llvm::Mips16FrameLowering, llvm::MipsSEFrameLowering, llvm::SparcFrameLowering, llvm::SIFrameLowering, llvm::AVRFrameLowering, llvm::RISCVFrameLowering, llvm::SystemZFrameLowering, and llvm::BPFFrameLowering.
Definition at line 76 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(), isProfitableForNoCSROpt(), isSafeForNoCSROpt(), MRI, llvm::TargetMachine::Options, Reg, llvm::BitVector::resize(), llvm::BitVector::set(), and TRI.
Referenced by llvm::BPFFrameLowering::determineCalleeSaves(), llvm::SystemZFrameLowering::determineCalleeSaves(), llvm::RISCVFrameLowering::determineCalleeSaves(), llvm::AVRFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::determineCalleeSaves(), llvm::SparcFrameLowering::determineCalleeSaves(), llvm::Mips16FrameLowering::determineCalleeSaves(), llvm::MipsSEFrameLowering::determineCalleeSaves(), llvm::ARCFrameLowering::determineCalleeSaves(), llvm::VEFrameLowering::determineCalleeSaves(), llvm::LanaiFrameLowering::determineCalleeSaves(), llvm::XCoreFrameLowering::determineCalleeSaves(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::HexagonFrameLowering::determineCalleeSaves(), llvm::X86FrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::determineCalleeSavesSGPR(), 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::SIFrameLowering, llvm::SystemZFrameLowering, llvm::RISCVFrameLowering, llvm::LanaiFrameLowering, llvm::MipsFrameLowering, llvm::XCoreFrameLowering, llvm::Thumb1FrameLowering, llvm::AVRFrameLowering, llvm::VEFrameLowering, llvm::WebAssemblyFrameLowering, llvm::BPFFrameLowering, llvm::MSP430FrameLowering, llvm::SparcFrameLowering, llvm::AArch64FrameLowering, and llvm::NVPTXFrameLowering.
Definition at line 323 of file TargetFrameLowering.h.
References llvm_unreachable.
Referenced by AssignProtectedObjSet(), and stashEntryDbgValues().
|
pure virtual |
Implemented in llvm::PPCFrameLowering, llvm::X86FrameLowering, llvm::SystemZFrameLowering, llvm::WebAssemblyFrameLowering, llvm::LanaiFrameLowering, llvm::HexagonFrameLowering, llvm::AArch64FrameLowering, llvm::ARCFrameLowering, llvm::SIFrameLowering, llvm::ARMFrameLowering, llvm::MSP430FrameLowering, llvm::XCoreFrameLowering, llvm::RISCVFrameLowering, llvm::SparcFrameLowering, llvm::VEFrameLowering, llvm::MipsSEFrameLowering, llvm::BPFFrameLowering, llvm::Thumb1FrameLowering, llvm::Mips16FrameLowering, llvm::NVPTXFrameLowering, llvm::R600FrameLowering, and llvm::AVRFrameLowering.
Referenced by AssignProtectedObjSet(), and llvm::createNVPTXPrologEpilogPass().
|
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::VEFrameLowering, llvm::MipsSEFrameLowering, llvm::BPFFrameLowering, llvm::Thumb1FrameLowering, llvm::Mips16FrameLowering, llvm::NVPTXFrameLowering, llvm::R600FrameLowering, and llvm::AVRFrameLowering.
Referenced by AssignProtectedObjSet(), and llvm::createNVPTXPrologEpilogPass().
|
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(), and llvm::Function::hasFnAttribute().
Referenced by determineCalleeSaves().
|
inlinevirtual |
Returns true if the target will correctly handle shrink wrapping.
Reimplemented in llvm::PPCFrameLowering, llvm::X86FrameLowering, llvm::AArch64FrameLowering, llvm::ARMFrameLowering, llvm::Thumb1FrameLowering, and llvm::MipsFrameLowering.
Definition at line 159 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 166 of file TargetFrameLowering.h.
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::VEFrameLowering.
Definition at line 146 of file TargetFrameLowering.h.
Referenced by assignCalleeSavedSpillSlots().
|
virtual |
Returns the callee-saved registers as computed by determineCalleeSaves in the BitVector SavedRegs.
Reimplemented in llvm::ARMFrameLowering.
Definition at line 63 of file TargetFrameLoweringImpl.cpp.
References llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineFunction::getFrameInfo(), llvm::MCRegisterInfo::getNumRegs(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), Info, llvm::MachineFrameInfo::isCalleeSavedInfoValid(), llvm::BitVector::resize(), llvm::BitVector::set(), and TRI.
Referenced by collectRegDefs(), llvm::ARMFrameLowering::getCalleeSaves(), and isCallableFunction().
|
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::VEFrameLowering, llvm::AArch64FrameLowering, llvm::SparcFrameLowering, 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(), llvm::DwarfCompileUnit::constructLabelDIE(), llvm::createNVPTXPrologEpilogPass(), emitDebugValueComment(), llvm::WinException::endFunclet(), llvm::SystemZFrameLowering::getFrameIndexReference(), 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 267 of file TargetFrameLowering.h.
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 149 of file TargetFrameLoweringImpl.cpp.
References llvm_unreachable.
Referenced by INITIALIZE_PASS().
|
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 153 of file TargetFrameLoweringImpl.cpp.
References llvm_unreachable.
Referenced by INITIALIZE_PASS().
|
inlinevirtual |
getNonLocalFrameIndexReference - This method returns the offset used to reference a frame index location.
The offset can be from either FP/BP/SP based on which base register is returned by llvm.localaddress.
Reimplemented in llvm::AArch64FrameLowering.
Definition at line 277 of file TargetFrameLowering.h.
|
inline |
getOffsetOfLocalArea - This method returns the offset of the local area from the stack pointer on entrance to a function.
Definition at line 116 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 80 of file TargetFrameLowering.h.
References llvm::Align::value().
Referenced by llvm::PPCFrameLowering::addScavengingSpillSlot(), AdjustStackOffset(), assignCalleeSavedSpillSlots(), AssignProtectedObjSet(), calculateSetFPREG(), checkNumAlignedDPRCS2Regs(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineFrameLayout(), llvm::AArch64FrameLowering::eliminateCallFramePseudoInstr(), llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::AVRFrameLowering::eliminateCallFramePseudoInstr(), llvm::Thumb1FrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::SparcFrameLowering::emitPrologue(), llvm::VEFrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), EnsureStackAlignment(), llvm::MachineFrameInfo::estimateStackSize(), llvm::RISCVFrameLowering::getFirstSPAdjustAmount(), getFnStackAlignment(), getMOVL(), llvm::X86InstrInfo::getSPAdjust(), llvm::X86FrameLowering::getWin64EHFrameIndexRef(), llvm::AArch64FrameLowering::getWinEHFuncletFrameSize(), llvm::MipsCallLowering::MipsHandler::handle(), llvm::MipsTargetLowering::HandleByVal(), llvm::RISCVFrameLowering::hasBP(), llvm::MipsSEFrameLowering::hasReservedCallFrame(), isFuncletReturnInstr(), LowerADJUST_TRAMPOLINE(), LowerDYNAMIC_STACKALLOC(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::ARMBaseRegisterInfo::needsFrameBaseReg(), llvm::TargetRegisterInfo::needsStackRealignment(), llvm::HexagonDAGToDAGISel::SelectFrameIndex(), and llvm::FunctionLoweringInfo::set().
|
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 127 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().
|
inline |
getStackGrowthDirection - Return the direction the stack grows
Definition at line 74 of file TargetFrameLowering.h.
Referenced by AdjustStackOffset(), AssignProtectedObjSet(), llvm::TargetInstrInfo::getSPAdjust(), INITIALIZE_PASS(), lookupCandidateBaseReg(), llvm::AArch64FrameLowering::processFunctionBeforeFrameFinalized(), and llvm::ScheduleDAGMILive::scheduleMI().
|
inlinevirtual |
Returns the StackID that scalable vectors should be associated with.
Reimplemented in llvm::AArch64FrameLowering.
Definition at line 367 of file TargetFrameLowering.h.
References llvm::TargetStackID::Default.
Referenced by llvm::FunctionLoweringInfo::set().
|
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 98 of file TargetFrameLowering.h.
References llvm::Align::value().
Referenced by AdjustStackOffset(), AssignProtectedObjSet(), llvm::MachineFrameInfo::estimateStackSize(), and mayCombineMisaligned().
|
inlinevirtual |
Reimplemented in llvm::X86FrameLowering, and llvm::AArch64FrameLowering.
Definition at line 312 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::PPCFrameLowering, llvm::X86FrameLowering, llvm::HexagonFrameLowering, llvm::SIFrameLowering, llvm::AArch64FrameLowering, llvm::ARCFrameLowering, llvm::ARMFrameLowering, llvm::LanaiFrameLowering, llvm::XCoreFrameLowering, llvm::MSP430FrameLowering, llvm::SystemZFrameLowering, llvm::WebAssemblyFrameLowering, llvm::VEFrameLowering, llvm::RISCVFrameLowering, llvm::SparcFrameLowering, llvm::MipsFrameLowering, llvm::R600FrameLowering, llvm::BPFFrameLowering, llvm::AVRFrameLowering, and llvm::NVPTXFrameLowering.
Referenced by addExclusiveRegPair(), AssignProtectedObjSet(), llvm::CodeViewDebug::beginFunctionImpl(), createPHIsForSelects(), llvm::LanaiRegisterInfo::eliminateFrameIndex(), estimateRSStackSizeLimit(), llvm::RISCVRegisterInfo::getFrameRegister(), llvm::AVRRegisterInfo::getFrameRegister(), llvm::X86TargetLowering::getRegisterByName(), llvm::MipsRegisterInfo::getRegPressureLimit(), llvm::MipsRegisterInfo::getReservedRegs(), and llvm::Mips16RegisterInfo::intRegClass().
|
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::SystemZFrameLowering, llvm::WebAssemblyFrameLowering, llvm::RISCVFrameLowering, llvm::VEFrameLowering, llvm::Mips16FrameLowering, llvm::MipsSEFrameLowering, llvm::Thumb1FrameLowering, llvm::SparcFrameLowering, and llvm::AVRFrameLowering.
Definition at line 235 of file TargetFrameLowering.h.
Referenced by AdjustStackOffset(), AssignProtectedObjSet(), llvm::MipsRegisterInfo::canRealignStack(), llvm::MipsFrameLowering::eliminateCallFramePseudoInstr(), llvm::XCoreFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), and llvm::MachineFrameInfo::estimateStackSize().
|
inlinevirtual |
Replace a StackProbe stub (if any) with the actual probe code inline.
Reimplemented in llvm::X86FrameLowering.
Definition at line 182 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 121 of file TargetFrameLowering.h.
Referenced by AssignProtectedObjSet().
|
inlinevirtual |
Check if the no-CSR optimisation is profitable for the given function.
Reimplemented in llvm::ARMFrameLowering.
Definition at line 386 of file TargetFrameLowering.h.
Referenced by determineCalleeSaves(), and isCallableFunction().
Check if given function is safe for not having callee saved registers.
This is used when interprocedural register allocation is enabled.
Definition at line 137 of file TargetFrameLoweringImpl.cpp.
References llvm::Function::hasAddressTaken(), llvm::Function::hasFnAttribute(), llvm::GlobalValue::hasLocalLinkage(), and llvm::Value::users().
Referenced by determineCalleeSaves(), and isCallableFunction().
|
inline |
isStackRealignable - This method returns whether the stack can be realigned.
Definition at line 104 of file TargetFrameLowering.h.
Referenced by llvm::MachineFunction::MachineFunction(), and llvm::FunctionLoweringInfo::set().
|
inlinevirtual |
Reimplemented in llvm::AArch64FrameLowering, and llvm::SIFrameLowering.
Definition at line 371 of file TargetFrameLowering.h.
References llvm::TargetStackID::Default, F(), and llvm::TargetStackID::NoAlloc.
Referenced by llvm::MIRParserImpl::initializeFrameInfo().
|
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 221 of file TargetFrameLowering.h.
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().
|
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 338 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::SIFrameLowering, llvm::MSP430FrameLowering, llvm::SystemZFrameLowering, and llvm::RISCVFrameLowering.
Definition at line 308 of file TargetFrameLowering.h.
Referenced by llvm::scavengeFrameVirtualRegs(), and stashEntryDbgValues().
|
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::AArch64FrameLowering, llvm::HexagonFrameLowering, llvm::ARCFrameLowering, llvm::MSP430FrameLowering, llvm::ARMFrameLowering, llvm::XCoreFrameLowering, llvm::SystemZFrameLowering, llvm::Mips16FrameLowering, llvm::Thumb1FrameLowering, and llvm::AVRFrameLowering.
Definition at line 212 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 199 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, llvm::VEFrameLowering, and llvm::SparcFrameLowering.
Definition at line 154 of file TargetFrameLowering.h.
Referenced by AdjustStackOffset(), and AssignProtectedObjSet().
1.8.13