class X86FrameLowering
Declaration
class X86FrameLowering : public TargetFrameLowering { /* full declaration omitted */ };
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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:28
Inherits from: TargetFrameLowering
Member Variables
- public const llvm::X86Subtarget& STI
- public const llvm::X86InstrInfo& TII
- public const llvm::X86RegisterInfo* TRI
- public unsigned int SlotSize
- public bool Is64Bit
- Is64Bit implies that x86_64 instructions are available.
- public bool IsLP64
- public bool Uses64BitFramePtr
- True if the 64-bit frame or stack pointer should be used. True for most 64-bit targets with the exception of x32. If this is false, 32-bit instruction operands should be used to manipulate StackPtr and FramePtr.
- public unsigned int StackPtr
Method Overview
- public void BuildCFI(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, const llvm::MCCFIInstruction & CFIInst, MachineInstr::MIFlag Flag = MachineInstr::NoFlags) const
- private llvm::MachineInstrBuilder BuildStackAdjustment(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, int64_t Offset, bool InEpilogue) const
- private void BuildStackAlignAND(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, unsigned int Reg, uint64_t MaxAlign) const
- public X86FrameLowering(const llvm::X86Subtarget & STI, llvm::MaybeAlign StackAlignOverride)
- public void adjustForHiPEPrologue(llvm::MachineFunction & MF, llvm::MachineBasicBlock & PrologueMBB) const
- public void adjustForSegmentedStacks(llvm::MachineFunction & MF, llvm::MachineBasicBlock & PrologueMBB) const
- private void adjustFrameForMsvcCxxEh(llvm::MachineFunction & MF) const
- private bool adjustStackWithPops(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, int Offset) const
- public bool assignCalleeSavedSpillSlots(llvm::MachineFunction & MF, const llvm::TargetRegisterInfo * TRI, std::vector<CalleeSavedInfo> & CSI) const
- private uint64_t calculateMaxStackAlign(const llvm::MachineFunction & MF) const
- public bool canSimplifyCallFramePseudos(const llvm::MachineFunction & MF) const
- public bool canUseAsEpilogue(const llvm::MachineBasicBlock & MBB) const
- public bool canUseAsPrologue(const llvm::MachineBasicBlock & MBB) const
- public bool canUseLEAForSPInEpilogue(const llvm::MachineFunction & MF) const
- public void determineCalleeSaves(llvm::MachineFunction & MF, llvm::BitVector & SavedRegs, llvm::RegScavenger * RS = nullptr) const
- public MachineBasicBlock::iterator eliminateCallFramePseudoInstr(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MI) const
- public void emitCalleeSavedFrameMoves(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, bool IsPrologue) const
- public void emitCalleeSavedFrameMovesFullCFA(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI) const
- private void emitCatchRetReturnValue(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, llvm::MachineInstr * CatchRet) const
- public void emitEpilogue(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB) const
- public void emitPrologue(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB) const
- public void emitSPUpdate(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator & MBBI, const llvm::DebugLoc & DL, int64_t NumBytes, bool InEpilogue) const
- public void emitStackProbe(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, bool InProlog, Optional<MachineFunction::DebugInstrOperandPair> InstrNum = None) const
- private void emitStackProbeCall(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, bool InProlog, Optional<MachineFunction::DebugInstrOperandPair> InstrNum) const
- private void emitStackProbeInline(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, bool InProlog) const
- private void emitStackProbeInlineGeneric(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, bool InProlog) const
- private void emitStackProbeInlineGenericBlock(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, uint64_t Offset, uint64_t Align) const
- private void emitStackProbeInlineGenericLoop(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, uint64_t Offset, uint64_t Align) const
- private void emitStackProbeInlineWindowsCoreCLR64(llvm::MachineFunction & MF, llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, bool InProlog) const
- private void emitZeroCallUsedRegs(llvm::BitVector RegsToZero, llvm::MachineBasicBlock & MBB) const
- public bool enableShrinkWrapping(const llvm::MachineFunction & MF) const
- public llvm::StackOffset getFrameIndexReference(const llvm::MachineFunction & MF, int FI, llvm::Register & FrameReg) const
- public llvm::StackOffset getFrameIndexReferencePreferSP(const llvm::MachineFunction & MF, int FI, llvm::Register & FrameReg, bool IgnoreSPUpdates) const
- public llvm::StackOffset getFrameIndexReferenceSP(const llvm::MachineFunction & MF, int FI, llvm::Register & SPReg, int Adjustment) const
- public int getInitialCFAOffset(const llvm::MachineFunction & MF) const
- public llvm::Register getInitialCFARegister(const llvm::MachineFunction & MF) const
- private unsigned int getPSPSlotOffsetFromSP(const llvm::MachineFunction & MF) const
- public int getWin64EHFrameIndexRef(const llvm::MachineFunction & MF, int FI, llvm::Register & SPReg) const
- private unsigned int getWinEHFuncletFrameSize(const llvm::MachineFunction & MF) const
- public unsigned int getWinEHParentFrameOffset(const llvm::MachineFunction & MF) const
- public bool has128ByteRedZone(const llvm::MachineFunction & MF) const
- public bool hasFP(const llvm::MachineFunction & MF) const
- public bool hasReservedCallFrame(const llvm::MachineFunction & MF) const
- public void inlineStackProbe(llvm::MachineFunction & MF, llvm::MachineBasicBlock & PrologMBB) const
- private bool isWin64Prologue(const llvm::MachineFunction & MF) const
- public int mergeSPUpdates(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator & MBBI, bool doMergeWithPrevious) const
- private bool needsDwarfCFI(const llvm::MachineFunction & MF) const
- public bool needsFrameIndexResolution(const llvm::MachineFunction & MF) const
- public void orderFrameObjects(const llvm::MachineFunction & MF, SmallVectorImpl<int> & ObjectsToAllocate) const
- public void processFunctionBeforeFrameFinalized(llvm::MachineFunction & MF, llvm::RegScavenger * RS) const
- public void processFunctionBeforeFrameIndicesReplaced(llvm::MachineFunction & MF, llvm::RegScavenger * RS) const
- public bool restoreCalleeSavedRegisters(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MI, MutableArrayRef<llvm::CalleeSavedInfo> CSI, const llvm::TargetRegisterInfo * TRI) const
- public MachineBasicBlock::iterator restoreWin32EHStackPointers(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MBBI, const llvm::DebugLoc & DL, bool RestoreSP = false) const
- public void restoreWinEHStackPointersInParent(llvm::MachineFunction & MF) const
- public bool spillCalleeSavedRegisters(llvm::MachineBasicBlock & MBB, MachineBasicBlock::iterator MI, ArrayRef<llvm::CalleeSavedInfo> CSI, const llvm::TargetRegisterInfo * TRI) const
- public bool stackProbeFunctionModifiesSP() const
Inherited from TargetFrameLowering:
- public adjustForHiPEPrologue
- public adjustForSegmentedStacks
- public alignSPAdjust
- public allocateScavengingFrameIndexesNearIncomingSP
- public assignCalleeSavedSpillSlots
- public assignCalleeSavedSpillSlots
- public canSimplifyCallFramePseudos
- public canUseAsEpilogue
- public canUseAsPrologue
- public determineCalleeSaves
- public eliminateCallFramePseudoInstr
- public emitCalleeSavedFrameMovesFullCFA
- public emitEpilogue
- public emitPrologue
- public emitZeroCallUsedRegs
- public enableCFIFixup
- public enableCalleeSaveSkip
- public enableShrinkWrapping
- public enableStackSlotScavenging
- public getCalleeSavedSpillSlots
- public getCalleeSaves
- public getDwarfFrameBase
- public getFrameIndexReference
- public getFrameIndexReferencePreferSP
- public getInitialCFAOffset
- public getInitialCFARegister
- public getNonLocalFrameIndexReference
- public getOffsetOfLocalArea
- public getStackAlign
- public getStackAlignment
- public getStackAlignmentSkew
- public getStackGrowthDirection
- public getStackIDForScalableVectors
- public getTransientStackAlign
- public getWinEHParentFrameOffset
- public hasFP
- public hasReservedCallFrame
- public inlineStackProbe
- public isProfitableForNoCSROpt
- public isSafeForNoCSROpt
- public isStackIdSafeForLocalArea
- public isStackRealignable
- public isSupportedStackID
- public keepFramePointer
- public needsFrameIndexResolution
- public orderFrameObjects
- public processFunctionBeforeFrameFinalized
- public processFunctionBeforeFrameIndicesReplaced
- public resetCFIToInitialState
- public restoreCalleeSavedRegisters
- public spillCalleeSavedRegisters
- public stackProbeFunctionModifiesSP
- public targetHandlesStackFrameRounding
Methods
¶void BuildCFI(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
const llvm::MCCFIInstruction& CFIInst,
MachineInstr::MIFlag Flag =
MachineInstr::NoFlags) const
void BuildCFI(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
const llvm::MCCFIInstruction& CFIInst,
MachineInstr::MIFlag Flag =
MachineInstr::NoFlags) const
Description
Wraps up getting a CFI index and building a MachineInstr for it.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:178
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- const llvm::MCCFIInstruction& CFIInst
- MachineInstr::MIFlag Flag = MachineInstr::NoFlags
¶llvm::MachineInstrBuilder BuildStackAdjustment(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
int64_t Offset,
bool InEpilogue) const
llvm::MachineInstrBuilder BuildStackAdjustment(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
int64_t Offset,
bool InEpilogue) const
Description
Adjusts the stack pointer using LEA, SUB, or ADD.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:254
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- int64_t Offset
- bool InEpilogue
¶void BuildStackAlignAND(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
unsigned int Reg,
uint64_t MaxAlign) const
void BuildStackAlignAND(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
unsigned int Reg,
uint64_t MaxAlign) const
Description
Aligns the stack pointer by ANDing it with -MaxAlign.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:244
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- unsigned int Reg
- uint64_t MaxAlign
¶X86FrameLowering(
const llvm::X86Subtarget& STI,
llvm::MaybeAlign StackAlignOverride)
X86FrameLowering(
const llvm::X86Subtarget& STI,
llvm::MaybeAlign StackAlignOverride)
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:30
Parameters
- const llvm::X86Subtarget& STI
- llvm::MaybeAlign StackAlignOverride
¶void adjustForHiPEPrologue(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& PrologueMBB) const
void adjustForHiPEPrologue(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& PrologueMBB) const
Description
Adjust the prologue to add Erlang Run-Time System (ERTS) specific code in the assembly prologue to explicitly handle the stack.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:83
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& PrologueMBB
¶void adjustForSegmentedStacks(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& PrologueMBB) const
void adjustForSegmentedStacks(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& PrologueMBB) const
Description
Adjust the prologue to have the function use segmented stacks. This works by adding a check even before the "normal" function prologue.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:80
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& PrologueMBB
¶void adjustFrameForMsvcCxxEh(
llvm::MachineFunction& MF) const
void adjustFrameForMsvcCxxEh(
llvm::MachineFunction& MF) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:241
Parameters
¶bool adjustStackWithPops(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
int Offset) const
bool adjustStackWithPops(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
int Offset) const
Description
Make small positive stack adjustments using POPs.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:249
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- int Offset
¶bool assignCalleeSavedSpillSlots(
llvm::MachineFunction& MF,
const llvm::TargetRegisterInfo* TRI,
std::vector<CalleeSavedInfo>& CSI) const
bool assignCalleeSavedSpillSlots(
llvm::MachineFunction& MF,
const llvm::TargetRegisterInfo* TRI,
std::vector<CalleeSavedInfo>& CSI) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:90
Parameters
- llvm::MachineFunction& MF
- const llvm::TargetRegisterInfo* TRI
- std::vector<CalleeSavedInfo>& CSI
¶uint64_t calculateMaxStackAlign(
const llvm::MachineFunction& MF) const
uint64_t calculateMaxStackAlign(
const llvm::MachineFunction& MF) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:204
Parameters
- const llvm::MachineFunction& MF
¶bool canSimplifyCallFramePseudos(
const llvm::MachineFunction& MF) const
bool canSimplifyCallFramePseudos(
const llvm::MachineFunction& MF) const
Description
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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:107
Parameters
- const llvm::MachineFunction& MF
¶bool canUseAsEpilogue(
const llvm::MachineBasicBlock& MBB) const
bool canUseAsEpilogue(
const llvm::MachineBasicBlock& MBB) const
Description
Check whether or not the given \p 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\p MBB will be correctly handled by the target.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:165
Parameters
- const llvm::MachineBasicBlock& MBB
¶bool canUseAsPrologue(
const llvm::MachineBasicBlock& MBB) const
bool canUseAsPrologue(
const llvm::MachineBasicBlock& MBB) const
Description
Check whether or not the given \p 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\p 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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:158
Parameters
- const llvm::MachineBasicBlock& MBB
¶bool canUseLEAForSPInEpilogue(
const llvm::MachineFunction& MF) const
bool canUseLEAForSPInEpilogue(
const llvm::MachineFunction& MF) const
Description
Check that LEA can be used on SP in an epilogue sequence for \p MF.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:148
Parameters
- const llvm::MachineFunction& MF
¶void determineCalleeSaves(
llvm::MachineFunction& MF,
llvm::BitVector& SavedRegs,
llvm::RegScavenger* RS = nullptr) const
void determineCalleeSaves(
llvm::MachineFunction& MF,
llvm::BitVector& SavedRegs,
llvm::RegScavenger* RS = nullptr) const
Description
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() should actually get saved. The default implementation checks populates the \p 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 \p MF and \p RS. The preferred interface outside PEI is getCalleeSaves.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:86
Parameters
- llvm::MachineFunction& MF
- llvm::BitVector& SavedRegs
- llvm::RegScavenger* RS = nullptr
¶MachineBasicBlock::iterator
eliminateCallFramePseudoInstr(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MI) const
MachineBasicBlock::iterator
eliminateCallFramePseudoInstr(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MI) const
Description
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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:123
Parameters
¶void emitCalleeSavedFrameMoves(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool IsPrologue) const
void emitCalleeSavedFrameMoves(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool IsPrologue) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:71
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- bool IsPrologue
¶void emitCalleeSavedFrameMovesFullCFA(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI) const
void emitCalleeSavedFrameMovesFullCFA(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI) const
Description
With basic block sections, emit callee saved frame moves for basic blocks that are in a different section.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:68
Parameters
¶void emitCatchRetReturnValue(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
llvm::MachineInstr* CatchRet) const
void emitCatchRetReturnValue(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
llvm::MachineInstr* CatchRet) const
Description
Materialize the catchret target MBB in RAX.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:264
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- llvm::MachineInstr* CatchRet
¶void emitEpilogue(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB) const
void emitEpilogue(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:78
Parameters
¶void emitPrologue(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB) const
void emitPrologue(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB) const
Description
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:77
Parameters
¶void emitSPUpdate(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator& MBBI,
const llvm::DebugLoc& DL,
int64_t NumBytes,
bool InEpilogue) const
void emitSPUpdate(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator& MBBI,
const llvm::DebugLoc& DL,
int64_t NumBytes,
bool InEpilogue) const
Description
Emit a series of instructions to increment / decrement the stack pointer by a constant value.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:144
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator& MBBI
- const llvm::DebugLoc& DL
- int64_t NumBytes
- bool InEpilogue
¶void emitStackProbe(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog,
Optional<
MachineFunction::DebugInstrOperandPair>
InstrNum = None) const
void emitStackProbe(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog,
Optional<
MachineFunction::DebugInstrOperandPair>
InstrNum = None) const
Description
Emit target stack probe code. This is required for all large stack allocations on Windows. The caller is required to materialize the number of bytes to probe in RAX/EAX.\p InstrNum optionally contains a debug-info instruction number for the new stack pointer.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:57
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- bool InProlog
- Optional<MachineFunction::DebugInstrOperandPair> InstrNum = None
¶void emitStackProbeCall(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog,
Optional<
MachineFunction::DebugInstrOperandPair>
InstrNum) const
void emitStackProbeCall(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog,
Optional<
MachineFunction::DebugInstrOperandPair>
InstrNum) const
Description
Emit target stack probe as a call to a helper function
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:207
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- bool InProlog
- Optional<MachineFunction::DebugInstrOperandPair> InstrNum
¶void emitStackProbeInline(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog) const
void emitStackProbeInline(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog) const
Description
Emit target stack probe as an inline sequence.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:213
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- bool InProlog
¶void emitStackProbeInlineGeneric(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog) const
void emitStackProbeInlineGeneric(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:221
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- bool InProlog
¶void emitStackProbeInlineGenericBlock(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
uint64_t Offset,
uint64_t Align) const
void emitStackProbeInlineGenericBlock(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
uint64_t Offset,
uint64_t Align) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:225
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- uint64_t Offset
- uint64_t Align
¶void emitStackProbeInlineGenericLoop(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
uint64_t Offset,
uint64_t Align) const
void emitStackProbeInlineGenericLoop(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
uint64_t Offset,
uint64_t Align) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:231
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- uint64_t Offset
- uint64_t Align
¶void emitStackProbeInlineWindowsCoreCLR64(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog) const
void emitStackProbeInlineWindowsCoreCLR64(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool InProlog) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:216
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- bool InProlog
¶void emitZeroCallUsedRegs(
llvm::BitVector RegsToZero,
llvm::MachineBasicBlock& MBB) const
void emitZeroCallUsedRegs(
llvm::BitVector RegsToZero,
llvm::MachineBasicBlock& MBB) const
Description
Emit target zero call-used regs.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:238
Parameters
- llvm::BitVector RegsToZero
- llvm::MachineBasicBlock& MBB
¶bool enableShrinkWrapping(
const llvm::MachineFunction& MF) const
bool enableShrinkWrapping(
const llvm::MachineFunction& MF) const
Description
Returns true if the target will correctly handle shrink wrapping.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:168
Parameters
- const llvm::MachineFunction& MF
¶llvm::StackOffset getFrameIndexReference(
const llvm::MachineFunction& MF,
int FI,
llvm::Register& FrameReg) const
llvm::StackOffset getFrameIndexReference(
const llvm::MachineFunction& MF,
int FI,
llvm::Register& FrameReg) const
Description
getFrameIndexReference - This method should return the base register and offset used to reference a frame index location. The offset is returned directly, and the base register is returned via FrameReg.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:110
Parameters
- const llvm::MachineFunction& MF
- int FI
- llvm::Register& FrameReg
¶llvm::StackOffset getFrameIndexReferencePreferSP(
const llvm::MachineFunction& MF,
int FI,
llvm::Register& FrameReg,
bool IgnoreSPUpdates) const
llvm::StackOffset getFrameIndexReferencePreferSP(
const llvm::MachineFunction& MF,
int FI,
llvm::Register& FrameReg,
bool IgnoreSPUpdates) const
Description
Same as \c getFrameIndexReference, except that the stack pointer (as opposed to the frame pointer) will be the preferred value for \p FrameReg. This is generally used for emitting statepoint or EH tables that use offsets from RSP. If \p 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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:118
Parameters
- const llvm::MachineFunction& MF
- int FI
- llvm::Register& FrameReg
- bool IgnoreSPUpdates
¶llvm::StackOffset getFrameIndexReferenceSP(
const llvm::MachineFunction& MF,
int FI,
llvm::Register& SPReg,
int Adjustment) const
llvm::StackOffset getFrameIndexReferenceSP(
const llvm::MachineFunction& MF,
int FI,
llvm::Register& SPReg,
int Adjustment) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:115
Parameters
- const llvm::MachineFunction& MF
- int FI
- llvm::Register& SPReg
- int Adjustment
¶int getInitialCFAOffset(
const llvm::MachineFunction& MF) const
int getInitialCFAOffset(
const llvm::MachineFunction& MF) const
Description
Return initial CFA offset value i.e. the one valid at the beginning of the function (before any stack operations).
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:191
Parameters
- const llvm::MachineFunction& MF
¶llvm::Register getInitialCFARegister(
const llvm::MachineFunction& MF) const
llvm::Register getInitialCFARegister(
const llvm::MachineFunction& MF) const
Description
Return initial CFA register value i.e. the one valid at the beginning of the function (before any stack operations).
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:193
Parameters
- const llvm::MachineFunction& MF
¶unsigned int getPSPSlotOffsetFromSP(
const llvm::MachineFunction& MF) const
unsigned int getPSPSlotOffsetFromSP(
const llvm::MachineFunction& MF) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:259
Parameters
- const llvm::MachineFunction& MF
¶int getWin64EHFrameIndexRef(
const llvm::MachineFunction& MF,
int FI,
llvm::Register& SPReg) const
int getWin64EHFrameIndexRef(
const llvm::MachineFunction& MF,
int FI,
llvm::Register& SPReg) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:113
Parameters
- const llvm::MachineFunction& MF
- int FI
- llvm::Register& SPReg
¶unsigned int getWinEHFuncletFrameSize(
const llvm::MachineFunction& MF) const
unsigned int getWinEHFuncletFrameSize(
const llvm::MachineFunction& MF) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:261
Parameters
- const llvm::MachineFunction& MF
¶unsigned int getWinEHParentFrameOffset(
const llvm::MachineFunction& MF) const
unsigned int getWinEHParentFrameOffset(
const llvm::MachineFunction& MF) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:126
Parameters
- const llvm::MachineFunction& MF
¶bool has128ByteRedZone(
const llvm::MachineFunction& MF) const
bool has128ByteRedZone(
const llvm::MachineFunction& MF) const
Description
Return true if the function has a redzone (accessible bytes past the frame of the top of stack function) as part of it's ABI.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:197
Parameters
- const llvm::MachineFunction& MF
¶bool hasFP(const llvm::MachineFunction& MF) const
bool hasFP(const llvm::MachineFunction& MF) const
Description
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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:105
Parameters
- const llvm::MachineFunction& MF
¶bool hasReservedCallFrame(
const llvm::MachineFunction& MF) const
bool hasReservedCallFrame(
const llvm::MachineFunction& MF) const
Description
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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:106
Parameters
- const llvm::MachineFunction& MF
¶void inlineStackProbe(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& PrologMBB) const
void inlineStackProbe(
llvm::MachineFunction& MF,
llvm::MachineBasicBlock& PrologMBB) const
Description
Replace a StackProbe inline-stub with the actual probe code inline.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:65
Parameters
- llvm::MachineFunction& MF
- llvm::MachineBasicBlock& PrologMBB
¶bool isWin64Prologue(
const llvm::MachineFunction& MF) const
bool isWin64Prologue(
const llvm::MachineFunction& MF) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:200
Parameters
- const llvm::MachineFunction& MF
¶int mergeSPUpdates(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator& MBBI,
bool doMergeWithPrevious) const
int mergeSPUpdates(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator& MBBI,
bool doMergeWithPrevious) const
Description
Check the instruction before/after the passed instruction. If it is an ADD/SUB/LEA instruction it is deleted argument and the stack adjustment is returned as a positive value for ADD/LEA and a negative for SUB.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:139
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator& MBBI
- bool doMergeWithPrevious
¶bool needsDwarfCFI(
const llvm::MachineFunction& MF) const
bool needsDwarfCFI(
const llvm::MachineFunction& MF) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:202
Parameters
- const llvm::MachineFunction& MF
¶bool needsFrameIndexResolution(
const llvm::MachineFunction& MF) const
bool needsFrameIndexResolution(
const llvm::MachineFunction& MF) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:108
Parameters
- const llvm::MachineFunction& MF
¶void orderFrameObjects(
const llvm::MachineFunction& MF,
SmallVectorImpl<int>& ObjectsToAllocate) const
void orderFrameObjects(
const llvm::MachineFunction& MF,
SmallVectorImpl<int>& ObjectsToAllocate) const
Description
Order the symbols in the local stack. We want to place the local stack objects in some sort of sensible order. The heuristic we use is to try and pack them according to static number of uses and size in order to minimize code size.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:174
Parameters
- const llvm::MachineFunction& MF
- SmallVectorImpl<int>& ObjectsToAllocate
¶void processFunctionBeforeFrameFinalized(
llvm::MachineFunction& MF,
llvm::RegScavenger* RS) const
void processFunctionBeforeFrameFinalized(
llvm::MachineFunction& MF,
llvm::RegScavenger* RS) const
Description
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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:128
Parameters
¶void processFunctionBeforeFrameIndicesReplaced(
llvm::MachineFunction& MF,
llvm::RegScavenger* RS) const
void processFunctionBeforeFrameIndicesReplaced(
llvm::MachineFunction& MF,
llvm::RegScavenger* RS) const
Description
processFunctionBeforeFrameIndicesReplaced - This method is called immediately before MO_FrameIndex operands are eliminated, but after the frame is finalized. This method is optional.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:132
Parameters
¶bool restoreCalleeSavedRegisters(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MI,
MutableArrayRef<llvm::CalleeSavedInfo> CSI,
const llvm::TargetRegisterInfo* TRI) const
bool restoreCalleeSavedRegisters(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MI,
MutableArrayRef<llvm::CalleeSavedInfo> CSI,
const llvm::TargetRegisterInfo* TRI) const
Description
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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:100
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MI
- MutableArrayRef<llvm::CalleeSavedInfo> CSI
- const llvm::TargetRegisterInfo* TRI
¶MachineBasicBlock::iterator
restoreWin32EHStackPointers(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool RestoreSP = false) const
MachineBasicBlock::iterator
restoreWin32EHStackPointers(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MBBI,
const llvm::DebugLoc& DL,
bool RestoreSP = false) const
Description
Sets up EBP and optionally ESI based on the incoming EBP value. Only needed for 32-bit. Used in funclet prologues and at catchret destinations.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:185
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MBBI
- const llvm::DebugLoc& DL
- bool RestoreSP = false
¶void restoreWinEHStackPointersInParent(
llvm::MachineFunction& MF) const
void restoreWinEHStackPointersInParent(
llvm::MachineFunction& MF) const
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:189
Parameters
¶bool spillCalleeSavedRegisters(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MI,
ArrayRef<llvm::CalleeSavedInfo> CSI,
const llvm::TargetRegisterInfo* TRI) const
bool spillCalleeSavedRegisters(
llvm::MachineBasicBlock& MBB,
MachineBasicBlock::iterator MI,
ArrayRef<llvm::CalleeSavedInfo> CSI,
const llvm::TargetRegisterInfo* TRI) const
Description
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.
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:94
Parameters
- llvm::MachineBasicBlock& MBB
- MachineBasicBlock::iterator MI
- ArrayRef<llvm::CalleeSavedInfo> CSI
- const llvm::TargetRegisterInfo* TRI
¶bool stackProbeFunctionModifiesSP() const
bool stackProbeFunctionModifiesSP() const
Description
Does the stack probe function call return with a modified stack pointer?
Declared at: llvm/lib/Target/X86/X86FrameLowering.h:62