|
LLVM
3.7.0
|
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted. More...
#include <MachineFrameInfo.h>
Public Member Functions | |
| MachineFrameInfo (unsigned StackAlign, bool isStackRealign, bool RealignOpt) | |
| bool | hasStackObjects () const |
| Return true if there are any stack objects in this function. More... | |
| bool | hasVarSizedObjects () const |
| This method may be called any time after instruction selection is complete to determine if the stack frame for this function contains any variable sized objects. More... | |
| int | getStackProtectorIndex () const |
| Return the index for the stack protector object. More... | |
| void | setStackProtectorIndex (int I) |
| int | getFunctionContextIndex () const |
| Return the index for the function context object. More... | |
| void | setFunctionContextIndex (int I) |
| bool | isFrameAddressTaken () const |
| This method may be called any time after instruction selection is complete to determine if there is a call to @llvm.frameaddress in this function. More... | |
| void | setFrameAddressIsTaken (bool T) |
| bool | isReturnAddressTaken () const |
| This method may be called any time after instruction selection is complete to determine if there is a call to @llvm.returnaddress in this function. More... | |
| void | setReturnAddressIsTaken (bool s) |
| bool | hasStackMap () const |
| This method may be called any time after instruction selection is complete to determine if there is a call to builtin @llvm.experimental.stackmap. More... | |
| void | setHasStackMap (bool s=true) |
| bool | hasPatchPoint () const |
| This method may be called any time after instruction selection is complete to determine if there is a call to builtin @llvm.experimental.patchpoint. More... | |
| void | setHasPatchPoint (bool s=true) |
| int | getObjectIndexBegin () const |
| Return the minimum frame object index. More... | |
| int | getObjectIndexEnd () const |
| Return one past the maximum frame object index. More... | |
| unsigned | getNumFixedObjects () const |
| Return the number of fixed objects. More... | |
| unsigned | getNumObjects () const |
| Return the number of objects. More... | |
| void | mapLocalFrameObject (int ObjectIndex, int64_t Offset) |
| Map a frame index into the local object block. More... | |
| std::pair< int, int64_t > | getLocalFrameObjectMap (int i) |
| Get the local offset mapping for a for an object. More... | |
| int64_t | getLocalFrameObjectCount () |
| Return the number of objects allocated into the local object block. More... | |
| void | setLocalFrameSize (int64_t sz) |
| Set the size of the local object blob. More... | |
| int64_t | getLocalFrameSize () const |
| Get the size of the local object blob. More... | |
| void | setLocalFrameMaxAlign (unsigned Align) |
| Required alignment of the local object blob, which is the strictest alignment of any object in it. More... | |
| unsigned | getLocalFrameMaxAlign () const |
| Return the required alignment of the local object blob. More... | |
| bool | getUseLocalStackAllocationBlock () |
| Get whether the local allocation blob should be allocated together or let PEI allocate the locals in it directly. More... | |
| void | setUseLocalStackAllocationBlock (bool v) |
| setUseLocalStackAllocationBlock - Set whether the local allocation blob should be allocated together or let PEI allocate the locals in it directly. More... | |
| bool | isObjectPreAllocated (int ObjectIdx) const |
| Return true if the object was pre-allocated into the local block. More... | |
| int64_t | getObjectSize (int ObjectIdx) const |
| Return the size of the specified object. More... | |
| void | setObjectSize (int ObjectIdx, int64_t Size) |
| Change the size of the specified stack object. More... | |
| unsigned | getObjectAlignment (int ObjectIdx) const |
| Return the alignment of the specified stack object. More... | |
| void | setObjectAlignment (int ObjectIdx, unsigned Align) |
| setObjectAlignment - Change the alignment of the specified stack object. More... | |
| const AllocaInst * | getObjectAllocation (int ObjectIdx) const |
| Return the underlying Alloca of the specified stack object if it exists. More... | |
| int64_t | getObjectOffset (int ObjectIdx) const |
| Return the assigned stack offset of the specified object from the incoming stack pointer. More... | |
| void | setObjectOffset (int ObjectIdx, int64_t SPOffset) |
| Set the stack frame offset of the specified object. More... | |
| uint64_t | getStackSize () const |
| Return the number of bytes that must be allocated to hold all of the fixed size frame objects. More... | |
| void | setStackSize (uint64_t Size) |
| Set the size of the stack. More... | |
| unsigned | estimateStackSize (const MachineFunction &MF) const |
| Estimate and return the size of the stack frame. More... | |
| int | getOffsetAdjustment () const |
| Return the correction for frame offsets. More... | |
| void | setOffsetAdjustment (int Adj) |
| Set the correction for frame offsets. More... | |
| unsigned | getMaxAlignment () const |
| Return the alignment in bytes that this function must be aligned to, which is greater than the default stack alignment provided by the target. More... | |
| void | ensureMaxAlignment (unsigned Align) |
| Make sure the function is at least Align bytes aligned. More... | |
| bool | adjustsStack () const |
| Return true if this function adjusts the stack – e.g., when calling another function. More... | |
| void | setAdjustsStack (bool V) |
| bool | hasCalls () const |
| Return true if the current function has any function calls. More... | |
| void | setHasCalls (bool V) |
| bool | hasOpaqueSPAdjustment () const |
| Returns true if the function contains opaque dynamic stack adjustments. More... | |
| void | setHasOpaqueSPAdjustment (bool B) |
| bool | hasVAStart () const |
| Returns true if the function calls the llvm.va_start intrinsic. More... | |
| void | setHasVAStart (bool B) |
| bool | hasMustTailInVarArgFunc () const |
| Returns true if the function is variadic and contains a musttail call. More... | |
| void | setHasMustTailInVarArgFunc (bool B) |
| bool | hasTailCall () const |
| Returns true if the function contains a tail call. More... | |
| void | setHasTailCall () |
| unsigned | getMaxCallFrameSize () const |
| Return the maximum size of a call frame that must be allocated for an outgoing function call. More... | |
| void | setMaxCallFrameSize (unsigned S) |
| int | CreateFixedObject (uint64_t Size, int64_t SPOffset, bool Immutable, bool isAliased=false) |
| Create a new object at a fixed location on the stack. More... | |
| int | CreateFixedSpillStackObject (uint64_t Size, int64_t SPOffset) |
| Create a spill slot at a fixed location on the stack. More... | |
| bool | isFixedObjectIndex (int ObjectIdx) const |
| Returns true if the specified index corresponds to a fixed stack object. More... | |
| bool | isAliasedObjectIndex (int ObjectIdx) const |
| Returns true if the specified index corresponds to an object that might be pointed to by an LLVM IR value. More... | |
| bool | isImmutableObjectIndex (int ObjectIdx) const |
| isImmutableObjectIndex - Returns true if the specified index corresponds to an immutable object. More... | |
| bool | isSpillSlotObjectIndex (int ObjectIdx) const |
| Returns true if the specified index corresponds to a spill slot. More... | |
| bool | isDeadObjectIndex (int ObjectIdx) const |
| Returns true if the specified index corresponds to a dead object. More... | |
| bool | isVariableSizedObjectIndex (int ObjectIdx) const |
| Returns true if the specified index corresponds to a variable sized object. More... | |
| int | CreateStackObject (uint64_t Size, unsigned Alignment, bool isSS, const AllocaInst *Alloca=nullptr) |
| Create a new statically sized stack object, returning a nonnegative identifier to represent it. More... | |
| int | CreateSpillStackObject (uint64_t Size, unsigned Alignment) |
| Create a new statically sized stack object that represents a spill slot, returning a nonnegative identifier to represent it. More... | |
| void | RemoveStackObject (int ObjectIdx) |
| Remove or mark dead a statically sized stack object. More... | |
| int | CreateVariableSizedObject (unsigned Alignment, const AllocaInst *Alloca) |
| Notify the MachineFrameInfo object that a variable sized object has been created. More... | |
| const std::vector < CalleeSavedInfo > & | getCalleeSavedInfo () const |
| Returns a reference to call saved info vector for the current function. More... | |
| void | setCalleeSavedInfo (const std::vector< CalleeSavedInfo > &CSI) |
| Used by prolog/epilog inserter to set the function's callee saved information. More... | |
| bool | isCalleeSavedInfoValid () const |
| Has the callee saved info been calculated yet? More... | |
| void | setCalleeSavedInfoValid (bool v) |
| MachineBasicBlock * | getSavePoint () const |
| void | setSavePoint (MachineBasicBlock *NewSave) |
| MachineBasicBlock * | getRestorePoint () const |
| void | setRestorePoint (MachineBasicBlock *NewRestore) |
| BitVector | getPristineRegs (const MachineFunction &MF) const |
| Return a set of physical registers that are pristine. More... | |
| void | print (const MachineFunction &MF, raw_ostream &OS) const |
| Used by the MachineFunction printer to print information about stack objects. More... | |
| void | dump (const MachineFunction &MF) const |
| dump - Print the function to stderr. More... | |
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
This class is key to allowing stack frame representation optimizations, such as frame pointer elimination. It also allows more mundane (but still important) optimizations, such as reordering of abstract objects on the stack frame.
To support this, the class assigns unique integer identifiers to stack objects requested clients. These identifiers are negative integers for fixed stack objects (such as arguments passed on the stack) or nonnegative for objects that may be reordered. Instructions which refer to stack objects use a special MO_FrameIndex operand to represent these frame indexes.
Because this class keeps track of all references to the stack frame, it knows when a variable sized object is allocated on the stack. This is the sole condition which prevents frame pointer elimination, which is an important optimization on register-poor architectures. Because original variable sized alloca's in the source program are the only source of variable sized stack objects, it is safe to decide whether there will be any variable sized objects before all stack objects are known (for example, register allocator spill code never needs variable sized objects).
When prolog/epilog code emission is performed, the final stack frame is built and the machine instructions are modified to refer to the actual stack offsets of the object, eliminating all MO_FrameIndex operands from the program.
Abstract Stack Frame Information
Definition at line 80 of file MachineFrameInfo.h.
|
inlineexplicit |
Definition at line 253 of file MachineFrameInfo.h.
|
inline |
Return true if this function adjusts the stack – e.g., when calling another function.
This is only valid during and after prolog/epilog code insertion.
Definition at line 464 of file MachineFrameInfo.h.
Referenced by llvm::AArch64RegisterInfo::cannotEliminateFrame(), llvm::ARMBaseRegisterInfo::cannotEliminateFrame(), llvm::PPCFrameLowering::determineFrameLayout(), llvm::X86FrameLowering::emitPrologue(), llvm::MipsFrameLowering::estimateStackSize(), and estimateStackSize().
| int MachineFrameInfo::CreateFixedObject | ( | uint64_t | Size, |
| int64_t | SPOffset, | ||
| bool | Immutable, | ||
| bool | isAliased = false |
||
| ) |
Create a new object at a fixed location on the stack.
All fixed objects should be created before other objects are created for efficiency. By default, fixed objects are not pointed to by LLVM IR values. This returns an index with a negative value.
All fixed objects should be created before other objects are created for efficiency. By default, fixed objects are immutable. This returns an index with a negative value.
Definition at line 552 of file MachineFunction.cpp.
References Align(), clampStackAlignment(), and llvm::MinAlign().
Referenced by CalculateTailCallArgDest(), llvm::XCoreFunctionInfo::createLRSpillSlot(), llvm::PPCFrameLowering::determineCalleeSaves(), llvm::X86FrameLowering::determineCalleeSaves(), EmitTailCallStoreFPAndRetAddr(), EmitTailCallStoreRetAddr(), llvm::MSP430TargetLowering::getReturnAddressFrameIndex(), llvm::X86TargetLowering::getReturnAddressFrameIndex(), llvm::MIRParserImpl::initializeFrameInfo(), llvm::HexagonTargetLowering::LowerFormalArguments(), llvm::SystemZTargetLowering::LowerFormalArguments(), llvm::SparcTargetLowering::LowerFormalArguments_32(), llvm::SparcTargetLowering::LowerFormalArguments_64(), LowerINTRINSIC_W_CHAIN(), and llvm::MSP430FrameLowering::processFunctionBeforeFrameFinalized().
| int MachineFrameInfo::CreateFixedSpillStackObject | ( | uint64_t | Size, |
| int64_t | SPOffset | ||
| ) |
Create a spill slot at a fixed location on the stack.
Returns an index with a negative value.
Definition at line 570 of file MachineFunction.cpp.
References Align(), clampStackAlignment(), and llvm::MinAlign().
Referenced by llvm::X86FrameLowering::assignCalleeSavedSpillSlots(), and llvm::MIRParserImpl::initializeFrameInfo().
Create a new statically sized stack object that represents a spill slot, returning a nonnegative identifier to represent it.
Definition at line 525 of file MachineFunction.cpp.
References clampStackAlignment(), CreateStackObject(), and ensureMaxAlignment().
Referenced by llvm::HexagonFrameLowering::determineCalleeSaves(), and LowerSEHRESTOREFRAME().
| int MachineFrameInfo::CreateStackObject | ( | uint64_t | Size, |
| unsigned | Alignment, | ||
| bool | isSS, | ||
| const AllocaInst * | Alloca = nullptr |
||
| ) |
Create a new statically sized stack object, returning a nonnegative identifier to represent it.
Definition at line 510 of file MachineFunction.cpp.
References clampStackAlignment(), and ensureMaxAlignment().
Referenced by llvm::PPCFrameLowering::addScavengingSpillSlot(), llvm::X86TargetLowering::BuildFILD(), llvm::MipsFunctionInfo::createEhDataRegsFI(), llvm::XCoreFunctionInfo::createEHSpillSlot(), llvm::XCoreFunctionInfo::createFPSpillSlot(), llvm::XCoreFunctionInfo::createLRSpillSlot(), CreateSpillStackObject(), llvm::SelectionDAG::CreateStackTemporary(), llvm::MipsSEFrameLowering::determineCalleeSaves(), llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::X86TargetLowering::EmitInstrWithCustomInserter(), llvm::MipsFunctionInfo::getMoveF64ViaSpillFI(), llvm::MIRParserImpl::initializeFrameInfo(), llvm::SparcTargetLowering::LowerCall_32(), llvm::TargetLowering::LowerCallTo(), llvm::SparcTargetLowering::LowerF128_LibCallArg(), llvm::SparcTargetLowering::LowerF128Op(), llvm::AMDGPUTargetLowering::LowerGlobalAddress(), llvm::SystemZFrameLowering::processFunctionBeforeFrameFinalized(), llvm::XCoreFrameLowering::processFunctionBeforeFrameFinalized(), and llvm::FunctionLoweringInfo::set().
| int MachineFrameInfo::CreateVariableSizedObject | ( | unsigned | Alignment, |
| const AllocaInst * | Alloca | ||
| ) |
Notify the MachineFrameInfo object that a variable sized object has been created.
This must be created whenever a variable sized object is created, whether or not the index returned is actually used.
Definition at line 538 of file MachineFunction.cpp.
References clampStackAlignment(), and ensureMaxAlignment().
Referenced by llvm::MIRParserImpl::initializeFrameInfo(), and llvm::FunctionLoweringInfo::set().
| void MachineFrameInfo::dump | ( | const MachineFunction & | MF | ) | const |
dump - Print the function to stderr.
Definition at line 690 of file MachineFunction.cpp.
References llvm::dbgs(), and print().
| void MachineFrameInfo::ensureMaxAlignment | ( | unsigned | Align | ) |
Make sure the function is at least Align bytes aligned.
Definition at line 490 of file MachineFunction.cpp.
References Align().
Referenced by llvm::CCState::AllocateStack(), llvm::X86FrameLowering::assignCalleeSavedSpillSlots(), CreateSpillStackObject(), CreateStackObject(), CreateVariableSizedObject(), llvm::CCState::HandleByVal(), llvm::MIRParserImpl::initializeFrameInfo(), llvm::MachineFunction::MachineFunction(), and setObjectAlignment().
| unsigned MachineFrameInfo::estimateStackSize | ( | const MachineFunction & | MF | ) | const |
Estimate and return the size of the stack frame.
Definition at line 604 of file MachineFunction.cpp.
References adjustsStack(), Align(), llvm::TargetSubtargetInfo::getFrameLowering(), getMaxAlignment(), getMaxCallFrameSize(), getObjectAlignment(), getObjectIndexBegin(), getObjectIndexEnd(), getObjectOffset(), getObjectSize(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFunction::getSubtarget(), llvm::TargetFrameLowering::getTransientStackAlignment(), llvm::TargetFrameLowering::hasReservedCallFrame(), hasVarSizedObjects(), isDeadObjectIndex(), and llvm::TargetRegisterInfo::needsStackRealignment().
Referenced by llvm::XCoreFrameLowering::determineCalleeSaves(), llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::PPCFrameLowering::determineFrameLayout(), llvm::XCoreFunctionInfo::isLargeFrame(), and llvm::SystemZFrameLowering::processFunctionBeforeFrameFinalized().
|
inline |
Returns a reference to call saved info vector for the current function.
Definition at line 573 of file MachineFrameInfo.h.
Referenced by addPristines(), llvm::AArch64FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::MipsSEFrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::HexagonFrameLowering::emitPrologue(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), getPristineRegs(), llvm::Mips16InstrInfo::makeFrame(), llvm::MipsAsmPrinter::printSavedRegsBitmask(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), llvm::Mips16InstrInfo::restoreFrame(), and updateLiveness().
|
inline |
Return the index for the function context object.
This object is used for SjLj exceptions.
Definition at line 294 of file MachineFrameInfo.h.
|
inline |
Return the required alignment of the local object blob.
Definition at line 360 of file MachineFrameInfo.h.
Referenced by llvm::ARMBaseRegisterInfo::needsFrameBaseReg(), and llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized().
|
inline |
Return the number of objects allocated into the local object block.
Definition at line 347 of file MachineFrameInfo.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
Get the local offset mapping for a for an object.
Definition at line 340 of file MachineFrameInfo.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
|
inline |
Get the size of the local object blob.
Definition at line 353 of file MachineFrameInfo.h.
Referenced by llvm::AArch64RegisterInfo::hasBasePointer(), llvm::ARMBaseRegisterInfo::hasBasePointer(), llvm::AArch64RegisterInfo::needsFrameBaseReg(), llvm::ARMBaseRegisterInfo::needsFrameBaseReg(), and llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized().
|
inline |
Return the alignment in bytes that this function must be aligned to, which is greater than the default stack alignment provided by the target.
Definition at line 456 of file MachineFrameInfo.h.
Referenced by llvm::PPCFrameLowering::addScavengingSpillSlot(), llvm::PPCFrameLowering::determineFrameLayout(), emitAlignedDPRCS2Spills(), llvm::XCoreFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::MipsFrameLowering::estimateStackSize(), estimateStackSize(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::HexagonFrameLowering::needsAligna(), llvm::WebAssemblyRegisterInfo::needsStackRealignment(), llvm::HexagonRegisterInfo::needsStackRealignment(), llvm::AArch64RegisterInfo::needsStackRealignment(), llvm::X86RegisterInfo::needsStackRealignment(), llvm::ARMBaseRegisterInfo::needsStackRealignment(), llvm::PPCRegisterInfo::needsStackRealignment(), and llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized().
|
inline |
Return the maximum size of a call frame that must be allocated for an outgoing function call.
This is only available if CallFrameSetup/Destroy pseudo instructions are used by the target, and then only during or after prolog/epilog code insertion.
Definition at line 492 of file MachineFrameInfo.h.
Referenced by llvm::PPCFrameLowering::determineFrameLayout(), llvm::MipsFrameLowering::estimateStackSize(), estimateStackSize(), llvm::MipsSEFrameLowering::hasReservedCallFrame(), llvm::Mips16FrameLowering::hasReservedCallFrame(), llvm::Thumb1FrameLowering::hasReservedCallFrame(), llvm::ARMFrameLowering::hasReservedCallFrame(), and llvm::PPCRegisterInfo::lowerDynamicAlloc().
|
inline |
Return the number of fixed objects.
Definition at line 328 of file MachineFrameInfo.h.
|
inline |
Return the number of objects.
Definition at line 331 of file MachineFrameInfo.h.
Referenced by llvm::AMDGPUFrameLowering::getFrameIndexOffset(), llvm::AMDGPUInstrInfo::getIndirectIndexBegin(), and llvm::AMDGPUInstrInfo::getIndirectIndexEnd().
Return the alignment of the specified stack object.
Definition at line 395 of file MachineFrameInfo.h.
Referenced by llvm::addFrameReference(), AdjustStackOffset(), estimateStackSize(), llvm::HexagonEvaluator::evaluate(), fixupFuncForFI(), llvm::TargetInstrInfo::foldMemoryOperand(), llvm::X86InstrInfo::foldMemoryOperandImpl(), getFrameIndexMMO(), llvm::AMDGPUFrameLowering::getFrameIndexOffset(), llvm::X86FrameLowering::getFrameIndexOffset(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), llvm::MipsInstrInfo::GetMemOperand(), getMemsetStores(), llvm::SelectionDAG::InferPtrAlignment(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), llvm::MSP430InstrInfo::loadRegFromStackSlot(), llvm::XCoreInstrInfo::loadRegFromStackSlot(), llvm::SparcInstrInfo::loadRegFromStackSlot(), llvm::HexagonInstrInfo::loadRegFromStackSlot(), llvm::AArch64InstrInfo::loadRegFromStackSlot(), llvm::PPCInstrInfo::loadRegFromStackSlot(), llvm::ARMBaseInstrInfo::loadRegFromStackSlot(), llvm::Thumb1InstrInfo::storeRegToStackSlot(), llvm::Thumb2InstrInfo::storeRegToStackSlot(), llvm::MSP430InstrInfo::storeRegToStackSlot(), llvm::XCoreInstrInfo::storeRegToStackSlot(), llvm::HexagonInstrInfo::storeRegToStackSlot(), llvm::SparcInstrInfo::storeRegToStackSlot(), llvm::AArch64InstrInfo::storeRegToStackSlot(), llvm::PPCInstrInfo::storeRegToStackSlot(), and llvm::ARMBaseInstrInfo::storeRegToStackSlot().
|
inline |
Return the underlying Alloca of the specified stack object if it exists.
Returns 0 if none exists.
Definition at line 411 of file MachineFrameInfo.h.
|
inline |
Return the minimum frame object index.
Definition at line 322 of file MachineFrameInfo.h.
Referenced by llvm::VirtRegMap::assignVirt2StackSlot(), llvm::MipsFrameLowering::estimateStackSize(), estimateStackSize(), llvm::AMDGPUFrameLowering::getFrameIndexOffset(), and llvm::MSP430FrameLowering::processFunctionBeforeFrameFinalized().
|
inline |
Return one past the maximum frame object index.
Definition at line 325 of file MachineFrameInfo.h.
Referenced by llvm::MipsFrameLowering::estimateStackSize(), estimateStackSize(), and llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized().
|
inline |
Return the assigned stack offset of the specified object from the incoming stack pointer.
Definition at line 419 of file MachineFrameInfo.h.
References isDeadObjectIndex().
Referenced by llvm::BPFRegisterInfo::eliminateFrameIndex(), llvm::MSP430RegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::XCoreRegisterInfo::eliminateFrameIndex(), llvm::NVPTXRegisterInfo::eliminateFrameIndex(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::MipsRegisterInfo::eliminateFrameIndex(), llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::AArch64FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::MipsFrameLowering::estimateStackSize(), estimateStackSize(), llvm::TargetInstrInfo::foldMemoryOperand(), GetEHSpillList(), llvm::SystemZFrameLowering::getFrameIndexOffset(), llvm::HexagonFrameLowering::getFrameIndexOffset(), llvm::X86FrameLowering::getFrameIndexOffset(), llvm::TargetFrameLowering::getFrameIndexOffset(), llvm::X86FrameLowering::getFrameIndexOffsetFromSP(), llvm::SIMachineFunctionInfo::getSpilledReg(), GetSpillList(), llvm::SelectionDAG::isConsecutiveLoad(), isConsecutiveLSLoc(), MatchingStackOffset(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), llvm::AArch64FrameLowering::resolveFrameIndexReference(), and llvm::ARMFrameLowering::ResolveFrameIndexReference().
|
inline |
Return the size of the specified object.
Definition at line 381 of file MachineFrameInfo.h.
Referenced by llvm::addFrameReference(), AdjustStackOffset(), llvm::MipsFrameLowering::estimateStackSize(), estimateStackSize(), llvm::TargetInstrInfo::foldMemoryOperand(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::X86InstrInfo::foldMemoryOperandImpl(), getFrameIndexMMO(), llvm::AMDGPUFrameLowering::getFrameIndexOffset(), llvm::MipsInstrInfo::GetMemOperand(), llvm::SelectionDAG::isConsecutiveLoad(), isConsecutiveLSLoc(), llvm::SystemZInstrInfo::isStackSlotCopy(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), llvm::MSP430InstrInfo::loadRegFromStackSlot(), llvm::XCoreInstrInfo::loadRegFromStackSlot(), llvm::SparcInstrInfo::loadRegFromStackSlot(), llvm::HexagonInstrInfo::loadRegFromStackSlot(), llvm::AArch64InstrInfo::loadRegFromStackSlot(), llvm::PPCInstrInfo::loadRegFromStackSlot(), llvm::ARMBaseInstrInfo::loadRegFromStackSlot(), MatchingStackOffset(), llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized(), llvm::Thumb1InstrInfo::storeRegToStackSlot(), llvm::Thumb2InstrInfo::storeRegToStackSlot(), llvm::MSP430InstrInfo::storeRegToStackSlot(), llvm::XCoreInstrInfo::storeRegToStackSlot(), llvm::HexagonInstrInfo::storeRegToStackSlot(), llvm::SparcInstrInfo::storeRegToStackSlot(), llvm::AArch64InstrInfo::storeRegToStackSlot(), llvm::PPCInstrInfo::storeRegToStackSlot(), llvm::ARMBaseInstrInfo::storeRegToStackSlot(), and llvm::X86InstrInfo::storeRegToStackSlot().
|
inline |
Return the correction for frame offsets.
Definition at line 449 of file MachineFrameInfo.h.
Referenced by llvm::Thumb1FrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::SystemZFrameLowering::getFrameIndexOffset(), and llvm::TargetFrameLowering::getFrameIndexOffset().
| BitVector MachineFrameInfo::getPristineRegs | ( | const MachineFunction & | MF | ) | const |
Return a set of physical registers that are pristine.
Pristine registers hold a value that is useless to the current function, but that must be preserved - they are callee saved registers that are not saved.
Before the PrologueEpilogueInserter has placed the CSR spill code, this method always returns an empty set.
Definition at line 583 of file MachineFunction.cpp.
References getCalleeSavedInfo(), llvm::TargetRegisterInfo::getCalleeSavedRegs(), llvm::MCRegisterInfo::getNumRegs(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), I, isCalleeSavedInfoValid(), and llvm::BitVector::set().
Referenced by llvm::Thumb1FrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::RegScavenger::initRegState(), llvm::CriticalAntiDepBreaker::StartBlock(), and llvm::AggressiveAntiDepBreaker::StartBlock().
|
inline |
Definition at line 590 of file MachineFrameInfo.h.
Referenced by updateLiveness().
|
inline |
Definition at line 588 of file MachineFrameInfo.h.
Referenced by updateLiveness().
|
inline |
Return the index for the stack protector object.
Definition at line 289 of file MachineFrameInfo.h.
Referenced by llvm::SelectionDAGBuilder::visitSPDescriptorParent(), and WindowsRequiresStackProbe().
|
inline |
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
This is only valid after Prolog/Epilog code insertion has finalized the stack frame layout.
Definition at line 440 of file MachineFrameInfo.h.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::X86FrameLowering::adjustForSegmentedStacks(), llvm::PPCFrameLowering::determineFrameLayout(), llvm::MSP430RegisterInfo::eliminateFrameIndex(), llvm::SparcRegisterInfo::eliminateFrameIndex(), llvm::XCoreRegisterInfo::eliminateFrameIndex(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::MipsRegisterInfo::eliminateFrameIndex(), llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::PPCRegisterInfo::eliminateFrameIndex(), llvm::Mips16FrameLowering::emitEpilogue(), llvm::MipsSEFrameLowering::emitEpilogue(), llvm::SparcFrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitEpilogue(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::XCoreFrameLowering::emitEpilogue(), llvm::ARMFrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::MipsAsmPrinter::emitFrameDirective(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::XCoreFrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), llvm::SystemZFrameLowering::getAllocatedStackSize(), llvm::X86FrameLowering::getFrameIndexOffset(), llvm::TargetFrameLowering::getFrameIndexOffset(), llvm::X86FrameLowering::getFrameIndexOffsetFromSP(), llvm::PPCFrameLowering::hasFP(), llvm::HexagonFrameLowering::hasFP(), llvm::PPCRegisterInfo::lowerDynamicAlloc(), llvm::AArch64FrameLowering::resolveFrameIndexReference(), and llvm::ARMFrameLowering::ResolveFrameIndexReference().
|
inline |
Get whether the local allocation blob should be allocated together or let PEI allocate the locals in it directly.
Definition at line 364 of file MachineFrameInfo.h.
|
inline |
Return true if the current function has any function calls.
Definition at line 468 of file MachineFrameInfo.h.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::AArch64RegisterInfo::cannotEliminateFrame(), llvm::AArch64FrameLowering::canUseRedZone(), llvm::SystemZFrameLowering::determineCalleeSaves(), llvm::TargetOptions::DisableFramePointerElim(), llvm::SystemZFrameLowering::getAllocatedStackSize(), llvm::X86FrameLowering::getFrameIndexOffset(), llvm::ARMFrameLowering::hasFP(), llvm::HexagonFrameLowering::hasFP(), llvm::AArch64FrameLowering::hasFP(), and llvm::SelectionDAGISel::runOnMachineFunction().
|
inline |
Returns true if the function is variadic and contains a musttail call.
Definition at line 480 of file MachineFrameInfo.h.
|
inline |
Returns true if the function contains opaque dynamic stack adjustments.
Definition at line 472 of file MachineFrameInfo.h.
Referenced by llvm::X86RegisterInfo::hasBasePointer(), and llvm::X86FrameLowering::hasFP().
|
inline |
This method may be called any time after instruction selection is complete to determine if there is a call to builtin @llvm.experimental.patchpoint.
Definition at line 318 of file MachineFrameInfo.h.
Referenced by llvm::AArch64FrameLowering::hasFP(), llvm::X86FrameLowering::hasFP(), and llvm::PPCFrameLowering::needsFP().
|
inline |
This method may be called any time after instruction selection is complete to determine if there is a call to builtin @llvm.experimental.stackmap.
Definition at line 312 of file MachineFrameInfo.h.
Referenced by llvm::AArch64FrameLowering::hasFP(), llvm::X86FrameLowering::hasFP(), and llvm::PPCFrameLowering::needsFP().
|
inline |
Return true if there are any stack objects in this function.
Definition at line 281 of file MachineFrameInfo.h.
Referenced by llvm::NVPTXFrameLowering::emitPrologue(), llvm::X86FrameLowering::needsFrameIndexResolution(), llvm::TargetFrameLowering::needsFrameIndexResolution(), and llvm::SIRegisterInfo::requiresRegisterScavenging().
|
inline |
Returns true if the function contains a tail call.
Definition at line 484 of file MachineFrameInfo.h.
Referenced by getUnderlyingObjectsForInstr().
|
inline |
This method may be called any time after instruction selection is complete to determine if the stack frame for this function contains any variable sized objects.
Definition at line 286 of file MachineFrameInfo.h.
Referenced by llvm::PPCFrameLowering::addScavengingSpillSlot(), llvm::AArch64RegisterInfo::cannotEliminateFrame(), llvm::ARMBaseRegisterInfo::cannotEliminateFrame(), llvm::X86RegisterInfo::canRealignStack(), llvm::ARMFrameLowering::canSimplifyCallFramePseudos(), llvm::PPCFrameLowering::determineFrameLayout(), llvm::HexagonRegisterInfo::eliminateFrameIndex(), llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), estimateStackSize(), llvm::SystemZFrameLowering::getAllocatedStackSize(), llvm::AMDGPUInstrInfo::getIndirectIndexEnd(), llvm::MipsRegisterInfo::getReservedRegs(), llvm::AArch64RegisterInfo::hasBasePointer(), llvm::X86RegisterInfo::hasBasePointer(), llvm::ARMBaseRegisterInfo::hasBasePointer(), llvm::MipsFrameLowering::hasBP(), llvm::MipsFrameLowering::hasFP(), llvm::SparcFrameLowering::hasFP(), llvm::SystemZFrameLowering::hasFP(), llvm::MSP430FrameLowering::hasFP(), llvm::XCoreFrameLowering::hasFP(), llvm::ARMFrameLowering::hasFP(), llvm::AArch64FrameLowering::hasFP(), llvm::X86FrameLowering::hasFP(), llvm::MipsSEFrameLowering::hasReservedCallFrame(), llvm::SparcFrameLowering::hasReservedCallFrame(), llvm::Mips16FrameLowering::hasReservedCallFrame(), llvm::WebAssemblyFrameLowering::hasReservedCallFrame(), llvm::Thumb1FrameLowering::hasReservedCallFrame(), llvm::MSP430FrameLowering::hasReservedCallFrame(), llvm::ARMFrameLowering::hasReservedCallFrame(), llvm::AArch64FrameLowering::hasReservedCallFrame(), llvm::X86FrameLowering::hasReservedCallFrame(), llvm::HexagonFrameLowering::needsAligna(), llvm::PPCFrameLowering::needsFP(), llvm::ARMBaseRegisterInfo::needsFrameBaseReg(), llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized(), llvm::AArch64FrameLowering::resolveFrameIndexReference(), and llvm::AArch64RegisterInfo::useFPForScavengingIndex().
|
inline |
Returns true if the function calls the llvm.va_start intrinsic.
Definition at line 476 of file MachineFrameInfo.h.
Returns true if the specified index corresponds to an object that might be pointed to by an LLVM IR value.
Definition at line 513 of file MachineFrameInfo.h.
Referenced by llvm::FixedStackPseudoSourceValue::isAliased().
|
inline |
Has the callee saved info been calculated yet?
Definition at line 584 of file MachineFrameInfo.h.
Referenced by addPristines(), and getPristineRegs().
Returns true if the specified index corresponds to a dead object.
Definition at line 538 of file MachineFrameInfo.h.
Referenced by estimateStackSize(), getObjectOffset(), llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized(), and setObjectOffset().
Returns true if the specified index corresponds to a fixed stack object.
Definition at line 507 of file MachineFrameInfo.h.
Referenced by llvm::HexagonRegisterInfo::eliminateFrameIndex(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), getMemsetStores(), LowerAsSplatVectorLoad(), MatchingStackOffset(), llvm::AArch64FrameLowering::resolveFrameIndexReference(), and llvm::ARMFrameLowering::ResolveFrameIndexReference().
|
inline |
This method may be called any time after instruction selection is complete to determine if there is a call to @llvm.frameaddress in this function.
Definition at line 300 of file MachineFrameInfo.h.
Referenced by llvm::AArch64RegisterInfo::cannotEliminateFrame(), llvm::ARMBaseRegisterInfo::cannotEliminateFrame(), llvm::PPCFrameLowering::emitPrologue(), llvm::MipsFrameLowering::hasFP(), llvm::SparcFrameLowering::hasFP(), llvm::MSP430FrameLowering::hasFP(), llvm::ARMFrameLowering::hasFP(), llvm::AArch64FrameLowering::hasFP(), and llvm::X86FrameLowering::hasFP().
isImmutableObjectIndex - Returns true if the specified index corresponds to an immutable object.
Definition at line 521 of file MachineFrameInfo.h.
Referenced by llvm::FixedStackPseudoSourceValue::isConstant().
Return true if the object was pre-allocated into the local block.
Definition at line 374 of file MachineFrameInfo.h.
Referenced by llvm::HexagonRegisterInfo::eliminateFrameIndex().
|
inline |
This method may be called any time after instruction selection is complete to determine if there is a call to @llvm.returnaddress in this function.
Definition at line 306 of file MachineFrameInfo.h.
Referenced by getPrologueDeath(), llvm::Mips16FrameLowering::spillCalleeSavedRegisters(), llvm::MipsSEFrameLowering::spillCalleeSavedRegisters(), and llvm::Thumb1FrameLowering::spillCalleeSavedRegisters().
Returns true if the specified index corresponds to a spill slot.
Definition at line 531 of file MachineFrameInfo.h.
Referenced by emitComments(), llvm::FixedStackPseudoSourceValue::mayAlias(), and llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized().
Returns true if the specified index corresponds to a variable sized object.
Definition at line 546 of file MachineFrameInfo.h.
|
inline |
Map a frame index into the local object block.
Definition at line 334 of file MachineFrameInfo.h.
References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized().
| void MachineFrameInfo::print | ( | const MachineFunction & | MF, |
| raw_ostream & | OS | ||
| ) | const |
Used by the MachineFunction printer to print information about stack objects.
Implemented in MachineFunction.cpp.
Definition at line 653 of file MachineFunction.cpp.
References llvm::TargetSubtargetInfo::getFrameLowering(), llvm::TargetFrameLowering::getOffsetOfLocalArea(), and llvm::MachineFunction::getSubtarget().
Referenced by dump(), and llvm::MachineFunction::print().
|
inline |
Remove or mark dead a statically sized stack object.
Definition at line 562 of file MachineFrameInfo.h.
|
inline |
Definition at line 465 of file MachineFrameInfo.h.
Referenced by GetTLSADDR(), and llvm::MIRParserImpl::initializeFrameInfo().
|
inline |
Used by prolog/epilog inserter to set the function's callee saved information.
Definition at line 579 of file MachineFrameInfo.h.
|
inline |
Definition at line 586 of file MachineFrameInfo.h.
|
inline |
Definition at line 301 of file MachineFrameInfo.h.
References T.
Referenced by getFRAMEADDR(), llvm::MIRParserImpl::initializeFrameInfo(), llvm::MSP430TargetLowering::LowerFRAMEADDR(), llvm::HexagonTargetLowering::LowerFRAMEADDR(), LowerINTRINSIC_W_CHAIN(), and LowerVASTART().
|
inline |
Definition at line 295 of file MachineFrameInfo.h.
References I.
|
inline |
Definition at line 469 of file MachineFrameInfo.h.
Referenced by GetTLSADDR(), llvm::MIRParserImpl::initializeFrameInfo(), llvm::SparcTargetLowering::LowerGlobalTLSAddress(), llvm::SparcTargetLowering::makeAddress(), and llvm::SelectionDAGISel::runOnMachineFunction().
|
inline |
Definition at line 481 of file MachineFrameInfo.h.
Referenced by llvm::MIRParserImpl::initializeFrameInfo(), and llvm::FunctionLoweringInfo::set().
|
inline |
Definition at line 473 of file MachineFrameInfo.h.
Referenced by llvm::MIRParserImpl::initializeFrameInfo(), and llvm::FunctionLoweringInfo::set().
Definition at line 319 of file MachineFrameInfo.h.
Referenced by llvm::MIRParserImpl::initializeFrameInfo(), and llvm::FastISel::selectPatchpoint().
Definition at line 313 of file MachineFrameInfo.h.
Referenced by llvm::MIRParserImpl::initializeFrameInfo(), and llvm::FastISel::selectStackmap().
|
inline |
Definition at line 485 of file MachineFrameInfo.h.
Referenced by llvm::HexagonTargetLowering::LowerCall().
|
inline |
Definition at line 477 of file MachineFrameInfo.h.
Referenced by llvm::MIRParserImpl::initializeFrameInfo(), and llvm::FunctionLoweringInfo::set().
|
inline |
Required alignment of the local object blob, which is the strictest alignment of any object in it.
Definition at line 357 of file MachineFrameInfo.h.
References Align().
Referenced by llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized().
|
inline |
Set the size of the local object blob.
Definition at line 350 of file MachineFrameInfo.h.
Referenced by llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized().
|
inline |
Definition at line 493 of file MachineFrameInfo.h.
Referenced by llvm::PPCFrameLowering::determineFrameLayout(), and llvm::MIRParserImpl::initializeFrameInfo().
setObjectAlignment - Change the alignment of the specified stack object.
Definition at line 402 of file MachineFrameInfo.h.
References Align(), and ensureMaxAlignment().
Referenced by emitAlignedDPRCS2Spills(), getMemcpyLoadsAndStores(), getMemmoveLoadsAndStores(), getMemsetStores(), llvm::MIRParserImpl::initializeFrameInfo(), and LowerAsSplatVectorLoad().
|
inline |
Set the stack frame offset of the specified object.
The offset is relative to the stack pointer on entry to the function.
Definition at line 429 of file MachineFrameInfo.h.
References isDeadObjectIndex().
Referenced by AdjustStackOffset(), llvm::MIRParserImpl::initializeFrameInfo(), and llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized().
|
inline |
Change the size of the specified stack object.
Definition at line 388 of file MachineFrameInfo.h.
|
inline |
Set the correction for frame offsets.
Definition at line 452 of file MachineFrameInfo.h.
Referenced by llvm::Thumb1FrameLowering::emitPrologue(), llvm::ARMFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), and llvm::MIRParserImpl::initializeFrameInfo().
|
inline |
Definition at line 591 of file MachineFrameInfo.h.
|
inline |
Definition at line 307 of file MachineFrameInfo.h.
Referenced by llvm::MIRParserImpl::initializeFrameInfo(), LowerINTRINSIC_W_CHAIN(), llvm::MSP430TargetLowering::LowerRETURNADDR(), llvm::HexagonTargetLowering::LowerRETURNADDR(), and LowerRETURNADDR().
|
inline |
Definition at line 589 of file MachineFrameInfo.h.
|
inline |
Definition at line 290 of file MachineFrameInfo.h.
References I.
|
inline |
Set the size of the stack.
Definition at line 443 of file MachineFrameInfo.h.
Referenced by llvm::PPCFrameLowering::determineFrameLayout(), llvm::Thumb1FrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), and llvm::MIRParserImpl::initializeFrameInfo().
|
inline |
setUseLocalStackAllocationBlock - Set whether the local allocation blob should be allocated together or let PEI allocate the locals in it directly.
Definition at line 369 of file MachineFrameInfo.h.
Referenced by llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized().
1.8.6