Represents an abstract stack frame until prolog/epilog code is inserted.
Synopsis
Declared in <llvm/CodeGen/MachineFrameInfo.h>
class MachineFrameInfo;
Description
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.
Enums
Name |
Description |
Stack Smashing Protection (SSP) rules require that vulnerable stack allocations are located close the stack protector. |
Member Functions
Name |
Description |
|
Constructors |
Create a new object at a fixed location on the stack. |
|
Create a spill slot at a fixed location on the stack. Returns an index with a negative value. |
|
Create a new statically sized stack object that represents a spill slot, returning a nonnegative identifier to represent it. |
|
Create a new statically sized stack object, returning a nonnegative identifier to represent it. |
|
Create a variable‐sized stack object and return its frame index. |
|
Remove or mark dead a statically sized stack object. |
|
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. |
|
Remove the underlying Alloca of the specified stack object if it exists. This generally should not be used and is for reduction tooling. |
|
Clear all shrink‐wrapping restore points. |
|
Clear all shrink‐wrapping save points. |
|
Compute the maximum size of a call frame for this function. |
|
Return true if this stack ID should be considered in MaxAlignment. |
|
Print the function frame info to stderr. |
|
Make sure the function's frame is at least Align bytes aligned. |
|
Estimate and return the size of the stack frame. |
|
Returns how many bytes of callee‐saved registers the target pushed in the prologue. Only used for debug info. |
|
|
|
Return the frame‐pointer policy for this function. |
|
Return the index for the function context object. This object is used for SjLj exceptions. |
|
Return the required alignment of the local object blob. |
|
Return the number of objects allocated into the local object block. |
|
Get the local offset mapping for an object. |
|
Get the size of the local object blob. |
|
Return alignment of this function's frame. |
|
Return the maximum size of a call frame that must be allocated. |
|
Return the number of fixed objects. |
|
Return the number of objects. |
|
Return the alignment of the specified stack object. |
|
Return the underlying Alloca of the specified stack object if it exists. Returns 0 if none exists. |
|
Return the minimum frame object index. |
|
Return one past the maximum frame object index. |
|
Return the assigned stack offset of the specified object from the incoming stack pointer. |
|
Return the SSP layout kind for the specified object. |
|
Return the size of the specified object. |
|
Return the correction for frame offsets. |
|
Return a set of physical registers that are pristine. |
|
Return the shrink‐wrapping restore points for this function. |
|
Return the shrink‐wrapping save points for this function. |
|
Return the stack ID associated with the specified object. |
|
Return the index for the stack protector object. |
|
Return the number of bytes allocated for fixed‐size frame objects. |
|
Return the size of the unsafe stack frame. |
|
Get whether the local allocation blob should be allocated together or let PEI allocate the locals in it directly. |
|
Return true if the current function has any function calls. |
|
Returns true if the function contains operations which will lower down to instructions which manipulate the stack pointer. |
|
Return true if a function context frame index has been set. |
|
Returns true if the function is variadic and contains a musttail call. |
|
Returns true if the function contains opaque dynamic stack adjustments. |
|
This method may be called any time after instruction selection is complete to determine if there is a call to builtin @llvm.experimental.patchpoint. |
|
Return true if the object uses a scalable‐vector stack ID. |
|
This method may be called any time after instruction selection is complete to determine if there is a call to builtin @llvm.experimental.stackmap. |
|
Return true if there are any stack objects in this function. |
|
Return true if a stack protector frame index has been set. |
|
Returns true if the function contains a tail call. |
|
Returns true if the function calls the llvm.va_start intrinsic. |
|
Return true if the stack frame contains any variable‐sized objects. |
|
Returns true if the specified index corresponds to an object that might be pointed to by an LLVM IR value. |
|
Has the callee saved info been calculated yet? |
|
Return true if the index is a callee‐saved spill slot. |
|
Returns true if the specified index corresponds to a dead object. |
|
Returns true if the specified index corresponds to a fixed stack object. |
|
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. |
|
Returns true if the specified index corresponds to an immutable object. |
|
Return true if the maximum call‐frame size has been computed. |
|
Return true if the object was pre‐allocated into the local block. |
|
Return true if the object has been sign‐extended. |
|
Return true if the object has been zero‐extended. |
|
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. |
|
Return true if |
|
Returns true if the specified index corresponds to a spill slot. |
|
Return true if the stack may be realigned. |
|
Return true if the index is a statepoint spill slot. |
|
Returns true if the specified index corresponds to a variable sized object. |
|
Map a frame index into the local object block. |
|
Mark the specified object as a statepoint spill slot. |
|
Return true if this function requires a split stack prolog. |
|
Used by the MachineFunction printer to print information about stack objects. Implemented in MachineFunction.cpp. |
|
Record whether this function adjusts the stack. |
|
Set how many bytes of callee‐saved registers to report for CodeView. |
|
Used by prolog/epilog inserter to set the function's callee saved information. |
|
Record whether the callee‐saved info has been calculated. |
|
Record whether @llvm.frameaddress is taken in this function. |
|
Set the frame‐pointer policy for this function. |
|
Set the frame index of the SjLj function context object. |
|
Record whether the current function has any function calls. |
|
Record whether copies imply a stack‐pointer adjustment. |
|
Record whether this varargs function contains a musttail call. |
|
Record whether the function contains opaque dynamic stack adjustments. |
|
Record whether this function contains an @llvm.experimental.patchpoint. |
|
Record whether this function contains an @llvm.experimental.stackmap. |
|
Record whether the function contains a tail call. |
|
Record whether the function calls llvm.va_start. |
|
Set "maybe pointed to by an LLVM IR value" for an object. |
|
Mark whether the index is a callee‐saved spill slot. |
|
Marks the immutability of an object. |
|
Set the required alignment of the local object blob. |
|
Set the size of the local object blob. |
|
Overwrite alignment of this function's frame. |
|
Set the maximum size of an outgoing call frame. |
|
Change the alignment of the specified stack object. |
|
Set the stack frame offset of the specified object. The offset is relative to the stack pointer on entry to the function. |
|
Set whether the object has been sign‐extended. |
|
Set the SSP layout kind for the specified object. |
|
Change the size of the specified stack object. |
|
Set whether the object has been zero‐extended. |
|
Set the correction for frame offsets. |
|
Set the shrink‐wrapping restore points for this function. |
|
Record whether @llvm.returnaddress is taken in this function. |
|
Set the shrink‐wrapping save points for this function. |
|
Set the stack ID associated with the specified object. |
|
Set the frame index of the stack protector object. |
|
Set the size of the stack. |
|
Set the size of the unsafe stack frame. |
|
Set whether the local allocation blob should be allocated together. |
|
Return true if stack realignment is forced by function attributes or if the stack alignment. |
Created with MrDocs