Represents phi nodes for memory accesses.
Synopsis
Declared in <llvm/Analysis/MemorySSA.h>
class MemoryPhi final
: public MemoryAccess
Description
These have the same semantic as regular phi nodes, with the exception that only one phi will ever exist in a given basic block. Guaranteeing one phi per block means guaranteeing there is only ever one valid reaching MemoryDef/MemoryPHI along each path to the phi node. This is ensured by not allowing disambiguation of the RHS of a MemoryDef or a MemoryPhi's operands. That is, given if (a) { store %a store %b } it must be transformed into if (a) { 1 = MemoryDef(liveOnEntry) store %a 2 = MemoryDef(1) store %b } and not if (a) { 1 = MemoryDef(liveOnEntry) store %a 2 = MemoryDef(liveOnEntry) store %b } even if the two stores do not conflict. Otherwise, both 1 and 2 reach the end of the branch, and if there are not two phi nodes, one will be disconnected completely from the SSA graph below that point. Because MemoryUse's do not generate new definitions, they do not have this issue.
Base Classes
Name |
Description |
Base class for MemoryUse, MemoryDef, and MemoryPhi nodes in MemorySSA. |
Types
Name |
Description |
Const iterator for directly iterating over the operand Values. |
|
Iterator for directly iterating over the operand Values. |
Type Aliases
Name |
Description |
Intrusive‐list node type for the all‐accesses list. |
|
Intrusive‐list node type for the defs‐only list. |
|
Iterator over the incoming basic blocks of this MemoryPhi. |
|
Const iterator over the incoming basic blocks of this MemoryPhi. |
|
Const user iterator for a memory access. |
|
Const iterator over this user's operand |
|
Range of const operand |
|
Const iterator over this value's uses. |
|
Const iterator over this value's users. |
|
The user iterators for a memory access |
|
Iterator over this user's operand |
|
Range of mutable operand |
|
Iterator over this value's uses. |
|
Iterator over this value's users. |
Enums
Name |
Description |
Concrete subclass of this. |
Member Functions
Name |
Description |
|
Construct a MemoryPhi for block |
Assignment operators |
|
|
|
Add an incoming value to the end of the PHI list |
|
This method should only be used by the Use class. |
|
Assert in debug builds that modules containing this value are materialized. |
|
Assert that every module containing this value is fully materialized. |
|
|
|
|
|
|
|
Return true if this pointer's memory may be freed in its defining scope. |
|
|
|
|
|
Delete a pointer to a generic Value. |
|
Drop all references to operands. |
|
Remove every uses that can safely be removed. |
|
Remove every use of this value in |
|
Dump this memory access to stderr for debugging. |
|
Return the first index of the specified basic block in the value list for this PHI. Returns ‐1 if no instance. |
|
Return the basic block that contains this memory access. |
|
All values hold a context through their type. |
|
|
|
Returns the descriptor co‐allocated with this User instance. |
|
Return the unique ID of this MemoryPhi. |
|
|
|
Return incoming value number x |
|
Return the incoming value associated with predecessor block |
|
|
|
Return a constant reference to the value's name. |
|
Return this value's name, or a printed operand string if it is unnamed. |
|
Return the number of incoming edges |
|
Return the number of operands. |
|
This method computes the number of uses of this Value. |
|
Return operand at index |
|
|
|
|
|
Returns an alignment of the pointer value. |
|
Returns the number of bytes known to be dereferenceable for the pointer value. |
|
If this ptr is provably equal to |
|
Return the raw optional flags value contained in this value. |
|
|
|
|
|
|
|
All values are typed, get the type of this value. |
|
|
|
Return an ID for the concrete type of this object. |
|
Return the symbol‐table name entry for this value, if any. |
|
Return true if this value has exactly N undroppable uses. |
|
Return true if this value has N undroppable uses or more. |
|
Return true if this Value has exactly N uses. |
|
Return true if this value has N uses or more. |
|
Return true if this value has a name in the symbol table. |
|
Return true if there is exactly one use of this value. |
|
Return true if there is exactly one user of this value. |
|
Check if this Value has a use‐list. |
|
Return true if there is a value handle associated with this value. |
|
|
|
Return whether this user's uses may be dropped without affecting correctness. |
|
Return true if this value is a swifterror value. |
|
Return true if there is metadata referencing this value. |
|
Check if this value is used in the specified basic block. |
|
|
|
Return true if there are no currently materialized uses. |
|
|
|
|
|
|
|
Mutate the type of this Value to be of the specified type. |
|
|
|
|
|
|
|
|
|
Delete operators |
|
|
Deleted; allocate concrete MemoryAccess subclasses instead. |
|
|
|
|
Change all uses of this to point to a new Value. |
|
Change non‐metadata uses of this to point to a new Value. |
|
Replace uses of one Value with another. |
|
Replace uses of this value that occur outside |
|
Replace selected uses of this value with |
|
Reverse the use‐list. |
|
Set incoming basic block number |
|
Set incoming value number |
|
Change the name of the value. |
|
Set the operand count for a User with hung‐off uses. |
|
|
|
Set the symbol‐table name entry for this value. |
|
Sort the use‐list. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Transfer the name from V to this value. |
|
Remove incoming edge |
|
Remove every incoming edge from basic block |
|
Remove every incoming edge for which |
|
Remove every incoming edge that uses memory access |
|
|
|
Return true if this value has no uses. |
|
|
|
Return the sole user when this value has exactly one user. |
|
Return an iterator to the first user of this value. |
|
Return true if this value has no users. |
|
|
|
|
|
|
|
|
|
|
Static Member Functions
Name |
Description |
Methods for support type inquiry through isa, cast, and dyn_cast. |
|
Remove the droppable use |
|
Map operand number |
|
Map incoming‐value index |
Static Data Members
Name |
Description |
The maximum alignment for instructions. |
|
Maximum absolute alignment in bytes ( |
Protected Types
Name |
Description |
Information about how a User object was allocated, to be passed into the User constructor. |
|
Indicates this User has operands "hung off" in another allocation. |
|
Indicates this User has operands co‐allocated. |
|
Indicates this User has operands and a descriptor co‐allocated . |
Protected Type Aliases
Name |
Description |
Function pointer type used to destroy a DerivedUser instance. |
Protected Enums
Name |
Description |
The number of operands in the subclass. |
Protected Member Functions
Name |
Description |
|
|
|
|
|
|
Erase all metadata attached to this Value. |
|
Erase all metadata attachments with the given kind. |
|
Erase all metadata attachments matching the given predicate. |
|
Append all metadata attached to this value into |
|
Return the unique ID of this MemoryDef or MemoryPhi. |
|
Get the current metadata attachments for the given kind, if any. |
|
Get metadata for the given kind, if any. |
|
Return the opaque subclass data bits stored in this value. |
|
Grow the number of hung off uses. Note that allocHungoffUses should be called if there are no uses. |
|
New operators |
|
Used by MemorySSA to change the block of a MemoryAccess when it is moved. |
|
|
|
Set the opaque subclass data bits stored in this value. |
Protected Static Member Functions
Name |
Description |
Return the operand Use at compile‐time index |
Protected Data Members
Name |
Description |
True if this value has a descriptor. |
|
Whether operands are stored in a separately allocated array. |
|
True if this value has a name in the symbol table. |
|
True if metadata references this value. |
|
Number of operands in this user. |
|
Hold arbitary subclass data. |
Friends
Name |
Description |
Encapsulates MemorySSA, including all data associated with memory accesses. |
Non-Member Functions
Name |
Description |
Get the upper bound on bit size for this Value |
|
Return the number of times the sign bit of the register is replicated into the other bits. |
|
ExtractTypeInfo ‐ Returns the type info, possibly bitcast, encoded in V. |
|
Find the earliest instruction that captures |
|
Given an aggregate and a sequence of indices, see if the scalar value indexed is already around as a register. |
|
Analyze the specified pointer to see if it can be expressed as a base pointer plus a constant offset. Return the base and offset to the caller. |
|
Const overload of GetPointerBaseWithConstantOffset. |
|
If we can compute the length of the string pointed to by the specified pointer, return 'len+1'. If we can't, return 0. |
|
Look up or compute a value in the value map. |
|
Return true if 'V & Mask' is known to be zero. We use this predicate to simplify operations downstream. Mask is known to be zero for bits that V cannot have. |
|
Visit a pointer and derived values to find capturing uses. |
|
Return which components of the pointer may be captured. |
|
Return true if this pointer may be captured by the enclosing function. |
|
Return true if this pointer may be captured before a given instruction. |
|
Return which components of the pointer may be captured on the path to |
|
Recursively delete a trivially dead instruction and its dead operands. |
|
Invoke a callback once for each lane up to an effective vector length. |
|
Split a block and insert an else‐branch at an instruction. |
|
Split a block and insert a conditional else‐branch around the split point. |
|
Split a block and insert a then‐branch at an instruction. |
|
Split a block and insert a conditional then‐branch around the split point. |
|
Split a block and insert optional then/else blocks around the split point. |
|
Split a block and insert optional then/else blocks at an instruction. |
|
Split a block and insert both then and else branches around the split point. |
|
Split a block and insert then/else branches at an instruction. |
|
Insert a simple counted for‐loop at a split point. |
|
Apply a metadata callback if |
|
Return true if the given assume operand bundle implies that |
|
Returns true if pointer |
|
Return true if we can prove that the specified FP value is never equal to ‐0.0. Users should use caution when considering PreserveSign denormal‐fp‐math. |
|
Return true if we can prove that the specified FP value is either NaN or never less than ‐0.0. |
|
See if the given exception handling personality function is one that we understand. If so, return a description of it; otherwise return Unknown. |
|
Enumerate immediate constant values of |
|
Determine the possible constant range of an integer or vector of integer value. This is intended as a cheap, non‐recursive check. |
|
Returns the known bits rather than passing by reference. |
|
Determine which bits of V are known to be either zero or one and return them in the KnownZero/KnownOne bit sets. |
|
Returns the known bits rather than passing by reference. |
|
Compute known bits for the demanded elements of |
|
Compute known bits for |
|
Compute known bits for |
|
Merge bits known from context‐dependent facts into Known. |
|
Wrapper to account for known fast math flags at the use instruction. |
|
Determine known floating‐point classes for |
|
Wrapper to account for known fast math flags at the use instruction. |
|
Determine which floating‐point classes are valid for |
|
Determine known floating‐point classes for |
|
Return the known sign bit of a floating‐point value, if provable. |
|
Compute whether a signed multiply of |
|
Compute whether a signed subtract of |
|
Compute whether an unsigned multiply of |
|
Compute whether an unsigned subtract of |
|
Decompose an icmp into the form ((X & Mask) pred C) if possible. |
|
Decompose an icmp into the form ((X & Mask) pred C) if possible. |
|
Emit a call to the bcmp function. |
|
Emit a call to the binary floating‐point libcall named Name. |
|
Emit a call to the binary DoubleFn, FloatFn, or LongDoubleFn for Op1's type. |
|
Emit a call to the calloc function. |
|
Emit a call to fputc with an int Char and a FILE pointer. |
|
Emit a call to fputs with a string pointer and a FILE pointer. |
|
Emit a call to fwrite with a pointer, size_t Size, and FILE pointer. |
|
Emit a call to the hot/cold operator new function. |
|
Emit a call to the hot/cold aligned operator new function. |
|
Emit a call to the hot/cold aligned nothrow operator new function. |
|
Emit a call to the hot/cold nothrow operator new function. |
|
Emit a call to the hot/cold size‐returning operator new function. |
|
Emit a call to the hot/cold size‐returning aligned operator new function. |
|
Emit a call to the malloc function. |
|
Emit a call to the memccpy function. |
|
Emit a call to memchr with a pointer, int Val, and size_t Len. |
|
Emit a call to the memcmp function. |
|
Emit a call to __memcpy_chk with size_t Len/ObjSize and pointer Dst/Src. |
|
Emit a call to the mempcpy function. |
|
Emit a call to the memrchr function, analogously to emitMemChr. |
|
Emit a call to putchar, assuming Char is an int. |
|
Emit a call to puts, assuming Str is some pointer. |
|
Emit a call to the snprintf function. |
|
Emit a call to the sprintf function. |
|
Emit a call to stpcpy for the specified pointer arguments. |
|
Emit a call to stpncpy for the specified pointer arguments and length. |
|
Emit a call to the strcat function. |
|
Emit a call to strchr for the specified pointer and character. |
|
Emit a call to strcpy for the specified pointer arguments. |
|
Emit a call to strdup for the specified pointer. |
|
Emit a call to the strlcat function. |
|
Emit a call to the strlcpy function. |
|
Emit a call to strlen for the specified pointer. |
|
Emit a call to the strncat function. |
|
Emit a call to the strncmp function to the builder. |
|
Emit a call to strncpy for the specified pointer arguments and length. |
|
Emit a call to the unary DoubleFn, FloatFn, or LongDoubleFn for Op's type. |
|
Emit a call to the unary floating‐point libcall named Name. |
|
Emit a call to the vsnprintf function. |
|
Emit a call to the vsprintf function. |
|
Emit a call to wcslen for the specified pointer. |
|
Returns the widenable condition in |
|
Const overload of findAllocaForValue. |
|
Returns unique alloca where the value comes from, or nullptr. If OffsetZero is true check that V points to the begining of the alloca. |
|
As above, for DVRDeclareValues. |
|
Finds dbg.declare records declaring local variables as living in the memory that 'V' points to. |
|
As above, for DVRValues. |
|
Finds the debug info records describing a value. |
|
Finds the dbg.values describing a value. |
|
Given a vector and an element number, see if the scalar value is already around as a register, for example if it were inserted then extracted from the vector. |
|
Call |
|
Return a begin iterator over the types indexed by GEP |
|
Return a begin iterator over the types indexed by GEP |
|
Return the end iterator for types indexed by GEP |
|
Return the end iterator for types indexed by GEP |
|
If a function is part of an allocation family (e.g. malloc/realloc/calloc/free), return the identifier for its family of functions. |
|
Like getObjectSize(), but only for base objects. |
|
Returns true if the value |
|
Compute the contents of a null‐terminated C string pointed to by |
|
If this is a call to an allocation function that initializes memory to a fixed value, return said value in the requested type. Otherwise, return nullptr. |
|
Return a valid Knowledge associated to the Value V if its Attribute kind is in AttrKinds and it matches the Filter. |
|
Return a valid Knowledge associated to the Value V if its Attribute kind is in AttrKinds and the knowledge is suitable to be used in the context of CtxI. |
|
Infer a known alignment for the specified pointer. |
|
Return the address space of the pointer operand of load or store |
|
Return the alignment of load or store instruction |
|
Return the pointer operand of a load or store, or null if |
|
Return the pointer operand of a load or store, or null if |
|
Return the value type accessed by load or store instruction |
|
Compute the size of the object pointed by Ptr. |
|
Return a known alignment for a value, optionally raising it first. |
|
Return the pointer operand of a load, store, or GEP, or null otherwise. |
|
Non‐const overload of getPointerOperand. |
|
Get splat value if the input is a splat vector or return nullptr. |
|
Strip GEP adjustments, pointer casts, and threadlocal.address from |
|
Non‐const overload of getUnderlyingObject. |
|
Like getUnderlyingObject(), but will try harder to find a single underlying object. In particular, this function also looks through selects and phis. |
|
This method is similar to getUnderlyingObject except that it can look through phi and select instructions and return multiple objects. |
|
This is a wrapper around getUnderlyingObjects and adds support for basic ptrtoint+arithmetic+inttoptr sequences. |
|
Return true if V is poison given that ValAssumedPoison is already poison. |
|
Invert a boolean condition, reusing an existing inverted copy when possible. |
|
Tests if a value is a call or invoke to a library function that allocates memory (either malloc, calloc, or strdup like). |
|
Tests if a value is a call or invoke to a library function that allocates or reallocates memory (either malloc, calloc, realloc, or strdup like). |
|
Tests if a value is a call or invoke to a library function that allocates or reallocates memory (either malloc, calloc, realloc, or strdup like). |
|
Return true if V is known to be the base of its memory object. |
|
If the specified value can be set by repeating the same byte in memory, return the i8 value that it is represented with. |
|
Return true if |
|
Return true if |
|
Returns true if the memory operations |
|
Returns true if V is always a dereferenceable pointer with sufficient alignment. |
|
Returns true if V is always dereferenceable for Size bytes with sufficient alignment. |
|
Equivalent to isDereferenceableAndAlignedPointer with an alignment of 1. |
|
Equivalent to isDereferenceableAndAlignedPointer with an alignment of 1. |
|
Returns true if the pointer is one which would have been considered an escape by isNotCapturedBefore. |
|
Iterator‐context overload of isGuaranteedNotToBePoison. |
|
Returns true if V cannot be poison, but may be undef. |
|
Returns true if V cannot be undef, but may be poison. |
|
Return true if this function can prove that V does not have undef bits and is never poison. |
|
Returns true iff |
|
Returns true iff |
|
Return true if V is unambiguously identified at the function level. |
|
Return true if this pointer refers to a distinct and identifiable object. |
|
Return the boolean condition value in the context of the given instruction if it is known based on dominating conditions. |
|
Return whether a compare is implied true or false by |
|
Return whether RHS is implied true or false by LHS, if known. |
|
Return true if the floating‐point value |
|
Return true iff: 1. X is poison implies Y is poison. 2. X is true implies Y is false. 3. X is false implies Y is true. Otherwise, return false. |
|
Return true if the two given values are negation. |
|
Returns true if the given value is known be negative (i.e. non‐positive and non‐zero). |
|
Return true if the floating‐point value can never contain a NaN or infinity. |
|
Return true if the floating‐point scalar value is not an infinity or if the floating‐point vector value has no infinities. |
|
Return true if the floating‐point scalar value is not a NaN or if the floating‐point vector value has no NaN elements. |
|
Return true if the given values are known to be non‐equal when defined. Supports scalar integer types only. |
|
Returns true if the give value is known to be non‐negative. |
|
Return true if the given value is known to be non‐zero when defined. |
|
Returns true if the given value is known be positive (i.e. non‐negative and non‐zero). |
|
Return true if the given value is known to have exactly one bit set when defined. |
|
Return true if |
|
Return true if this pointer is returned by a noalias function. |
|
Return true if Object memory is not visible after an unwind. |
|
Return true if we know that executing a load from this value cannot trap. |
|
Return true if we know that executing a load from this value cannot trap. |
|
Return true if each element of |
|
Returns true iff |
|
Returns true iff |
|
Return true if Object is writable without trapping. |
|
Return true if any lane of an i1 mask is known true or undef. |
|
Const overload of matchSelectPattern. |
|
Pattern match integer [SU]MIN, [SU]MAX and ABS idioms, returning the kind and providing the out parameter results if we successfully match. |
|
Return true if the only users of this pointer are lifetime markers. |
|
Return true if the only users of this pointer are lifetime markers or droppable instructions. |
|
Parses a widenable branch and returns Uses so they can be modified. |
|
Parses a widenable branch and returns its condition, widenable condition, and successor blocks. |
|
Collects the individual checks from a widenable guard's condition. |
|
Return an APInt of active lanes for a |
|
Intersect IR flags from scalar ops |
|
Replace a dbg.declare when its address is replaced. |
|
Replace uses dominated by an edge with another value. |
|
Replace uses dominated by an instruction with another value. |
|
Replace uses dominated by a block's end with another value. |
|
Conditionally replace uses dominated by an instruction with another value. |
|
Conditionally replace uses dominated by a block's end with another value. |
|
Conditionally replace uses dominated by an edge with another value. |
|
Set the alignment of load or store instruction |
|
Given operands for a AShr, fold the result or return nulll. |
|
Given operands for an Add, fold the result or return null. |
|
Given operands for an And, fold the result or return null. |
|
Given operands for an ExtractElementInst, fold the result or return null. |
|
Given operands for an ExtractValueInst, fold the result or return null. |
|
Given operands for an FAdd, fold the result or return null. |
|
Given operands for an FDiv, fold the result or return null. |
|
Given operands for the multiplication of a FMA, fold the result or return null. |
|
Given operands for an FMul, fold the result or return null. |
|
Given operand for an FNeg, fold the result or return null. |
|
Given operands for an FRem, fold the result or return null. |
|
Given operands for an FSub, fold the result or return null. |
|
Given an operand for a Freeze, see if we can fold the result. |
|
Given operands for an InsertElement, fold the result or return null. |
|
Given operands for an InsertValueInst, fold the result or return null. |
|
Given operands for a LShr, fold the result or return null. |
|
Given operands for a Mul, fold the result or return null. |
|
Given operands for an Or, fold the result or return null. |
|
Given operands for an SDiv, fold the result or return null. |
|
Given operands for an SRem, fold the result or return null. |
|
Given operands for a SelectInst, fold the result or return null. |
|
Given operands for a Shl, fold the result or return null. |
|
Given operands for a ShuffleVectorInst, fold the result or return null. |
|
Given operands for a Sub, fold the result or return null. |
|
Given operands for a UDiv, fold the result or return null. |
|
Given operands for a URem, fold the result or return null. |
|
See if V simplifies when its operand Op is replaced with RepOp. |
|
Given operands for an Xor, fold the result or return null. |
|
Const overload of stripNullTest. |
|
Returns the inner value X if the expression has the form f(X) where f(X) == 0 if and only if X == 0, otherwise returns nullptr. |
|
Try to raise a controlled object's alignment to a preferred value. |
|
Wrap an array of |
|
Convert a |
|
Try to convert |
|
Return true if |
|
Match a deferred const Value* determined later in the same match expression. |
|
Match a deferred Value* determined later in the same match expression. |
|
Match if we have a specific specified value. |
|
Match against the nested pattern, and capture the value if we match. |
|
Match a const value, capturing it if we match. |
|
Match against the nested pattern, and capture the value if we match. |
|
Match a value, capturing it if we match. |
|
Return true if CoerceAvailableValueToLoadType would succeed if it was called. |
|
Try to coerce a stored value to a must‐aliased load of a different type. |
|
Extract bits for a load from a clobbering store or load at a given offset. |
|
Evaluate a filter expression for an instrumentation opportunity. |
|
Map V to its ARCInstKind equivalence class. |
|
Assuming the given instruction is one of the special calls such as objc_retain or objc_release, return the RCIdentity root of the argument of the call. |
|
Determine which objc runtime call instruction class V belongs to. |
|
Return the RCIdentity root of value |
|
Return the non‐const RCIdentity root of value |
|
Return the underlying ObjC object pointer for |
|
A wrapper for GetUnderlyingObjCPtr used for results memoization. |
|
Return true if |
|
Return true if this value refers to a distinct and identifiable object. |
|
Test whether |
|
Test whether the given value is possible a retainable object pointer. |
Created with MrDocs