LLVM  3.7.0
Public Member Functions | Public Attributes | List of all members
llvm::X86FrameLowering Class Reference

#include <X86FrameLowering.h>

Inheritance diagram for llvm::X86FrameLowering:
[legend]
Collaboration diagram for llvm::X86FrameLowering:
[legend]

Public Member Functions

 X86FrameLowering (const X86Subtarget &STI, unsigned StackAlignOverride)
 
void emitStackProbeCall (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, DebugLoc DL) const
 Emit a call to the target's stack probe function. More...
 
void emitCalleeSavedFrameMoves (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, DebugLoc DL) const
 
void emitPrologue (MachineFunction &MF, MachineBasicBlock &MBB) const override
 emitProlog/emitEpilog - These methods insert prolog and epilog code into the function. More...
 
void emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) const override
 
void adjustForSegmentedStacks (MachineFunction &MF, MachineBasicBlock &PrologueMBB) const override
 Adjust the prologue to have the function use segmented stacks. More...
 
void adjustForHiPEPrologue (MachineFunction &MF, MachineBasicBlock &PrologueMBB) const override
 Erlang programs may need a special prologue to handle the stack size they might need at runtime. More...
 
void determineCalleeSaves (MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS=nullptr) const override
 This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() should actually get saved. More...
 
bool assignCalleeSavedSpillSlots (MachineFunction &MF, const TargetRegisterInfo *TRI, std::vector< CalleeSavedInfo > &CSI) const override
 assignCalleeSavedSpillSlots - Allows target to override spill slot assignment logic. More...
 
bool spillCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override
 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...
 
bool restoreCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override
 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...
 
bool hasFP (const MachineFunction &MF) const override
 hasFP - Return true if the specified function should have a dedicated frame pointer register. More...
 
bool hasReservedCallFrame (const MachineFunction &MF) const override
 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...
 
bool canSimplifyCallFramePseudos (const MachineFunction &MF) const override
 canSimplifyCallFramePseudos - If there is a reserved call frame, the call frame pseudos can be simplified. More...
 
bool needsFrameIndexResolution (const MachineFunction &MF) const override
 
int getFrameIndexOffset (const MachineFunction &MF, int FI) const override
 getFrameIndexOffset - Returns the displacement from the frame register to the stack frame of the specified index. More...
 
int getFrameIndexReference (const MachineFunction &MF, int FI, unsigned &FrameReg) const override
 getFrameIndexReference - This method should return the base register and offset used to reference a frame index location. More...
 
int getFrameIndexOffsetFromSP (const MachineFunction &MF, int FI) const
 
int getFrameIndexReferenceFromSP (const MachineFunction &MF, int FI, unsigned &FrameReg) const override
 Same as above, except that the 'base register' will always be RSP, not RBP on x86. More...
 
void eliminateCallFramePseudoInstr (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
 eliminateCallFramePseudoInstr - 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...
 
int mergeSPUpdates (MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, bool doMergeWithPrevious) const
 Check the instruction before/after the passed instruction. More...
 
void emitSPUpdate (MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, int64_t NumBytes, bool InEpilogue) const
 Emit a series of instructions to increment / decrement the stack pointer by a constant value. More...
 
bool canUseLEAForSPInEpilogue (const MachineFunction &MF) const
 Check that LEA can be used on SP in an epilogue sequence for MF. More...
 
bool canUseAsEpilogue (const MachineBasicBlock &MBB) const override
 Check whether or not the given MBB can be used as a epilogue for the target. More...
 
- Public Member Functions inherited from llvm::TargetFrameLowering
 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...
 
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...
 
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 const SpillSlotgetCalleeSavedSpillSlots (unsigned &NumEntries) const
 getCalleeSavedSpillSlots - This method returns a pointer to an array of pairs, that contains an entry for each callee saved register that must be spilled to a particular stack location if it is spilled. More...
 
virtual bool targetHandlesStackFrameRounding () const
 targetHandlesStackFrameRounding - Returns true if the target is responsible for rounding up the stack frame (probably at emitPrologue time). More...
 
virtual void adjustForFrameAllocatePrologue (MachineFunction &MF, MachineBasicBlock &PrologueMBB) const
 Adjust the prologue to add an allocation at a fixed offset from the frame pointer. More...
 
virtual bool noFramePointerElim (const MachineFunction &MF) const
 Return true if the target needs to disable frame pointer elimination. 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 bool canUseAsPrologue (const MachineBasicBlock &MBB) const
 Check whether or not the given MBB can be used as a prologue for the target. More...
 

Public Attributes

const X86SubtargetSTI
 
const TargetInstrInfoTII
 
const X86RegisterInfoTRI
 
unsigned SlotSize
 
bool Is64Bit
 Is64Bit implies that x86_64 instructions are available. More...
 
bool IsLP64
 
bool Uses64BitFramePtr
 True if the 64-bit frame or stack pointer should be used. More...
 
unsigned StackPtr
 

Additional Inherited Members

- Public Types inherited from llvm::TargetFrameLowering
enum  StackDirection { StackGrowsUp, StackGrowsDown }
 

Detailed Description

Definition at line 26 of file X86FrameLowering.h.

Constructor & Destructor Documentation

X86FrameLowering::X86FrameLowering ( const X86Subtarget STI,
unsigned  StackAlignOverride 
)

Member Function Documentation

void X86FrameLowering::adjustForHiPEPrologue ( MachineFunction MF,
MachineBasicBlock PrologueMBB 
) const
overridevirtual

Erlang programs may need a special prologue to handle the stack size they might need at runtime.

That is because Erlang/OTP does not implement a C stack but uses a custom implementation of hybrid stack/heap architecture. (for more information see Eric Stenman's Ph.D. thesis: http://publications.uu.se/uu/fulltext/nbn_se_uu_diva-2688.pdf)

CheckStack: temp0 = sp - MaxStack if( temp0 < SP_LIMIT(P) ) goto IncStack else goto OldStart OldStart: ... IncStack: call inc_stack # doubles the stack space temp0 = sp - MaxStack if( temp0 < SP_LIMIT(P) ) goto IncStack else goto OldStart

Reimplemented from llvm::TargetFrameLowering.

Definition at line 1756 of file X86FrameLowering.cpp.

References llvm::MachineBasicBlock::addLiveIn(), llvm::addRegOffset(), llvm::MachineBasicBlock::addSuccessor(), llvm::Function::arg_size(), llvm::MachineFunction::begin(), llvm::BuildMI(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::DL, llvm::dyn_cast(), llvm::MachineFunction::end(), F(), llvm::StringRef::find(), llvm::StringRef::find_first_of(), llvm::MCInstrInfo::get(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineOperand::getGlobal(), llvm::Value::getName(), llvm::MachineInstr::getOperand(), llvm::MachineFunction::getRegInfo(), GetScratchRegister(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFrameInfo::hasCalls(), I, Is64Bit, llvm::MachineInstr::isCall(), llvm::MachineOperand::isGlobal(), llvm::MachineRegisterInfo::isLiveIn(), IsLP64, llvm::X86Subtarget::isTargetLinux(), llvm::MachineBasicBlock::livein_begin(), llvm::MachineBasicBlock::livein_end(), llvm::AArch64CC::MI, llvm::StringRef::npos, llvm::MachineFunction::push_front(), SlotSize, STI, TII, and llvm::MachineFunction::verify().

void X86FrameLowering::adjustForSegmentedStacks ( MachineFunction MF,
MachineBasicBlock PrologueMBB 
) const
overridevirtual

Adjust the prologue to have the function use segmented stacks.

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

Reimplemented from llvm::TargetFrameLowering.

Definition at line 1509 of file X86FrameLowering.cpp.

References llvm::MachineInstrBuilder::addExternalSymbol(), llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::addLiveIn(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::BuildMI(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::DL, llvm::MCInstrInfo::get(), llvm::X86MachineFunctionInfo::getArgumentStackSize(), llvm::TargetMachine::getCodeModel(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getMMI(), llvm::MachineFunction::getRegInfo(), GetScratchRegister(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getTarget(), HasNestArgument(), Is64Bit, llvm::MachineRegisterInfo::isLiveIn(), IsLP64, llvm::X86Subtarget::isTargetDarwin(), llvm::X86Subtarget::isTargetDragonFly(), llvm::X86Subtarget::isTargetFreeBSD(), llvm::X86Subtarget::isTargetLinux(), llvm::X86Subtarget::isTargetWin32(), llvm::X86Subtarget::isTargetWin64(), llvm::Function::isVarArg(), llvm::RegState::Kill, kSplitStackAvailable, llvm::CodeModel::Large, llvm::MachineBasicBlock::livein_begin(), llvm::MachineBasicBlock::livein_end(), llvm::MachineFunction::push_front(), llvm::report_fatal_error(), llvm::MachineRegisterInfo::setPhysRegUsed(), llvm::MachineModuleInfo::setUsesMorestackAddr(), STI, TII, and llvm::MachineFunction::verify().

bool X86FrameLowering::assignCalleeSavedSpillSlots ( MachineFunction MF,
const TargetRegisterInfo TRI,
std::vector< CalleeSavedInfo > &  CSI 
) const
overridevirtual
bool X86FrameLowering::canSimplifyCallFramePseudos ( const MachineFunction MF) const
overridevirtual

canSimplifyCallFramePseudos - If there is a reserved call frame, the call frame pseudos can be simplified.

Having a FP, as in the default implementation, is not sufficient here since we can't always use it. Use a more nuanced condition.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 64 of file X86FrameLowering.cpp.

References llvm::X86RegisterInfo::hasBasePointer(), hasFP(), hasReservedCallFrame(), llvm::X86RegisterInfo::needsStackRealignment(), and TRI.

bool X86FrameLowering::canUseAsEpilogue ( const MachineBasicBlock MBB) const
overridevirtual

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.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 1933 of file X86FrameLowering.cpp.

References canUseLEAForSPInEpilogue(), llvm::MachineBasicBlock::getParent(), and terminatorsNeedFlagsAsInput().

bool X86FrameLowering::canUseLEAForSPInEpilogue ( const MachineFunction MF) const

Check that LEA can be used on SP in an epilogue sequence for MF.

Definition at line 1007 of file X86FrameLowering.cpp.

References llvm::TargetMachine::getMCAsmInfo(), llvm::MachineFunction::getTarget(), hasFP(), and llvm::MCAsmInfo::usesWindowsCFI().

Referenced by canUseAsEpilogue().

void X86FrameLowering::determineCalleeSaves ( MachineFunction MF,
BitVector SavedRegs,
RegScavenger RS = nullptr 
) const
overridevirtual

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 from llvm::TargetFrameLowering.

Definition at line 1428 of file X86FrameLowering.cpp.

References llvm::MachineFrameInfo::CreateFixedObject(), llvm::TargetFrameLowering::determineCalleeSaves(), llvm::X86RegisterInfo::getBaseRegister(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::X86MachineFunctionInfo::getTCReturnAddrDelta(), llvm::X86RegisterInfo::hasBasePointer(), llvm::BitVector::set(), SlotSize, and TRI.

void X86FrameLowering::eliminateCallFramePseudoInstr ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI 
) const
overridevirtual

eliminateCallFramePseudoInstr - 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.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 1884 of file X86FrameLowering.cpp.

References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::erase(), llvm::TargetInstrInfo::getCallFrameDestroyOpcode(), llvm::TargetFrameLowering::getStackAlignment(), hasReservedCallFrame(), I, llvm::RoundUpToAlignment(), and TII.

void X86FrameLowering::emitCalleeSavedFrameMoves ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
DebugLoc  DL 
) const
void X86FrameLowering::emitEpilogue ( MachineFunction MF,
MachineBasicBlock MBB 
) const
overridevirtual
void X86FrameLowering::emitPrologue ( MachineFunction MF,
MachineBasicBlock MBB 
) const
overridevirtual

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

emitPrologue - Push callee-saved registers onto the stack, which automatically adjust the stack pointer.

Adjust the stack pointer to allocate space for local variables. Also emit labels used by the exception handler to generate the exception handling frames.

Implements llvm::TargetFrameLowering.

Definition at line 638 of file X86FrameLowering.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::addRegOffset(), llvm::MachineFrameInfo::adjustsStack(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::BuildMI(), calculateSetFPREG(), contains(), llvm::MCCFIInstruction::createDefCfaOffset(), llvm::MCCFIInstruction::createDefCfaRegister(), llvm::MCCFIInstruction::createOffset(), llvm::DL, emitCalleeSavedFrameMoves(), emitSPUpdate(), emitStackProbeCall(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), FramePtr, llvm::MachineInstr::FrameSetup, llvm::MCInstrInfo::get(), llvm::StringRef::getAsInteger(), llvm::X86RegisterInfo::getBaseRegister(), llvm::X86MachineFunctionInfo::getCalleeSavedFrameSize(), llvm::Function::getCallingConv(), llvm::Function::getFnAttribute(), getFrameIndexOffset(), llvm::MachineFunction::getFrameInfo(), llvm::X86RegisterInfo::getFrameRegister(), llvm::MachineFunction::getFunction(), llvm::X86MachineFunctionInfo::getHasSEHFramePtrSave(), llvm::MachineFunction::getInfo(), llvm::TargetMachine::getMCAsmInfo(), llvm::MachineFunction::getMMI(), llvm::X86MachineFunctionInfo::getRestoreBasePointer(), llvm::X86MachineFunctionInfo::getRestoreBasePointerOffset(), llvm::X86MachineFunctionInfo::getSEHFramePtrSaveIndex(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::getTarget(), llvm::X86MachineFunctionInfo::getTCReturnAddrDelta(), llvm::Attribute::getValueAsString(), llvm::getX86SubSuperRegister(), llvm::X86RegisterInfo::hasBasePointer(), llvm::MachineModuleInfo::hasDebugInfo(), llvm::Function::hasFnAttribute(), hasFP(), llvm::MachineFrameInfo::hasVarSizedObjects(), I, llvm::MVT::i64, llvm::MachineBasicBlock::insert(), Is64Bit, llvm::X86Subtarget::isCallingConvWin64(), isEAXLiveIn(), llvm::isInt< 32 >(), llvm::X86Subtarget::isOSWindows(), llvm::TargetInstrInfo::isStoreToStackSlot(), llvm::X86Subtarget::isTarget64BitILP32(), llvm::X86Subtarget::isTargetMachO(), llvm::isUInt< 32 >(), llvm::RegState::Kill, mergeSPUpdates(), llvm::X86RegisterInfo::needsStackRealignment(), llvm::Function::needsUnwindTableEntry(), llvm::Attribute::NoRedZone, llvm::report_fatal_error(), llvm::RoundUpToAlignment(), llvm::X86MachineFunctionInfo::setCalleeSavedFrameSize(), llvm::MachineInstr::setFlag(), llvm::MachineInstrBuilder::setMIFlag(), llvm::MachineFrameInfo::setOffsetAdjustment(), llvm::MachineFrameInfo::setStackSize(), llvm::MachineFunction::shouldSplitStack(), SlotSize, StackPtr, STI, TII, TRI, Uses64BitFramePtr, usesTheStack(), and llvm::MCAsmInfo::usesWindowsCFI().

void X86FrameLowering::emitSPUpdate ( MachineBasicBlock MBB,
MachineBasicBlock::iterator MBBI,
int64_t  NumBytes,
bool  InEpilogue 
) const
void X86FrameLowering::emitStackProbeCall ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
DebugLoc  DL 
) const

Emit a call to the target's stack probe function.

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.

Definition at line 456 of file X86FrameLowering.cpp.

References llvm::MachineInstrBuilder::addReg(), llvm::AX, llvm::BuildMI(), llvm::RegState::Define, llvm::MCInstrInfo::get(), llvm::TargetMachine::getCodeModel(), llvm::MachineFunction::getTarget(), llvm::RegState::Implicit, Is64Bit, llvm::X86Subtarget::isTargetCygMing(), llvm::CodeModel::Large, llvm::SP, STI, llvm::ARMBuildAttrs::Symbol, and TII.

Referenced by emitPrologue().

int X86FrameLowering::getFrameIndexOffset ( const MachineFunction MF,
int  FI 
) const
overridevirtual
int X86FrameLowering::getFrameIndexOffsetFromSP ( const MachineFunction MF,
int  FI 
) const
int X86FrameLowering::getFrameIndexReference ( const MachineFunction MF,
int  FI,
unsigned FrameReg 
) const
overridevirtual

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.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 1210 of file X86FrameLowering.cpp.

References llvm::X86RegisterInfo::getBaseRegister(), getFrameIndexOffset(), llvm::X86RegisterInfo::getFrameRegister(), llvm::X86RegisterInfo::getStackRegister(), llvm::X86RegisterInfo::hasBasePointer(), llvm::X86RegisterInfo::needsStackRealignment(), and TRI.

int X86FrameLowering::getFrameIndexReferenceFromSP ( const MachineFunction MF,
int  FI,
unsigned FrameReg 
) const
overridevirtual

Same as above, except that the 'base register' will always be RSP, not RBP on x86.

This is used exclusively for lowering STATEPOINT nodes. TODO: This should really be a parameterizable choice.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 1284 of file X86FrameLowering.cpp.

References getFrameIndexOffsetFromSP(), llvm::X86RegisterInfo::getStackRegister(), llvm::X86RegisterInfo::hasBasePointer(), and TRI.

bool X86FrameLowering::hasFP ( const MachineFunction MF) const
overridevirtual
bool X86FrameLowering::hasReservedCallFrame ( const MachineFunction MF) const
overridevirtual

hasReservedCallFrame - Under normal circumstances, when a frame pointer is not required, we reserve argument space for call sites in the function immediately on entry to the current function.

This eliminates the need for add/sub sp brackets around call sites. Returns true if the call frame is included as part of the stack frame.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 54 of file X86FrameLowering.cpp.

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

Referenced by canSimplifyCallFramePseudos(), and eliminateCallFramePseudoInstr().

int X86FrameLowering::mergeSPUpdates ( MachineBasicBlock MBB,
MachineBasicBlock::iterator MBBI,
bool  doMergeWithPrevious 
) const

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.

Definition at line 374 of file X86FrameLowering.cpp.

References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::erase(), and StackPtr.

Referenced by emitEpilogue(), and emitPrologue().

bool X86FrameLowering::needsFrameIndexResolution ( const MachineFunction MF) const
overridevirtual
bool X86FrameLowering::restoreCalleeSavedRegisters ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI,
const TargetRegisterInfo TRI 
) const
overridevirtual

restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of load instructions via loadRegToStackSlot().

Returns false otherwise.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 1395 of file X86FrameLowering.cpp.

References llvm::BuildMI(), contains(), llvm::MachineBasicBlock::findDebugLoc(), llvm::MCInstrInfo::get(), llvm::TargetRegisterInfo::getMinimalPhysRegClass(), llvm::X86Subtarget::is64Bit(), llvm::TargetInstrInfo::loadRegFromStackSlot(), STI, and TII.

bool X86FrameLowering::spillCalleeSavedRegisters ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI,
const TargetRegisterInfo TRI 
) const
overridevirtual

spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of store instructions via storeRegToStackSlot().

Returns false otherwise.

Reimplemented from llvm::TargetFrameLowering.

Definition at line 1355 of file X86FrameLowering.cpp.

References llvm::MachineBasicBlock::addLiveIn(), llvm::BuildMI(), contains(), llvm::MachineBasicBlock::findDebugLoc(), llvm::MachineInstr::FrameSetup, llvm::MCInstrInfo::get(), llvm::TargetRegisterInfo::getMinimalPhysRegClass(), llvm::X86Subtarget::is64Bit(), llvm::RegState::Kill, llvm::AArch64CC::MI, llvm::MachineInstrBuilder::setMIFlag(), STI, llvm::TargetInstrInfo::storeRegToStackSlot(), and TII.

Member Data Documentation

bool llvm::X86FrameLowering::Is64Bit

Is64Bit implies that x86_64 instructions are available.

Definition at line 39 of file X86FrameLowering.h.

Referenced by adjustForHiPEPrologue(), adjustForSegmentedStacks(), emitEpilogue(), emitPrologue(), emitSPUpdate(), emitStackProbeCall(), and X86FrameLowering().

bool llvm::X86FrameLowering::IsLP64
unsigned llvm::X86FrameLowering::SlotSize
unsigned llvm::X86FrameLowering::StackPtr
const X86Subtarget& llvm::X86FrameLowering::STI
const TargetInstrInfo& llvm::X86FrameLowering::TII
const X86RegisterInfo* llvm::X86FrameLowering::TRI
bool llvm::X86FrameLowering::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.

Definition at line 46 of file X86FrameLowering.h.

Referenced by emitEpilogue(), emitPrologue(), and X86FrameLowering().


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