Expand description
An analysis to compute symbols that escape out from a function.
This could be into another function, or via ptr_to_int
etc.
Any transformations involving such symbols are unsafe.
Enums§
- Escaped
Symbols - Referred
Symbols - Provides Symbols, both Symbol::Locals and Symbol::Args, reachable
from a certain Value via chain of InstOp::GetElemPtr (GEP) instructions
or via InstOp::IntToPtr and InstOp::PtrToInt instruction patterns
specific to references, both referencing (
&
) and dereferencing (*
), and raw pointers, via__addr_of
. - Symbol
Constants§
Functions§
- combine_
indices - Combine a series of GEPs into one.
- compute_
escaped_ symbols - compute_
escaped_ symbols_ pass - create_
escaped_ symbols_ pass - get_
gep_ referred_ symbols - Get Symbols, both Symbol::Locals and Symbol::Args, reachable
from the
val
via chain of InstOp::GetElemPtr (GEP) instructions. Aval
can, via GEP instructions, refer indirectly to none, or one or more symbols. - get_
gep_ symbol - get_
loaded_ ptr_ values - Pointers that may possibly be loaded from the instruction
inst
. - get_
loaded_ symbols - Symbols that may possibly, directly or indirectly, be loaded from the instruction
inst
. - get_
memory_ offsets - Given a memory pointer instruction, compute the offset of indexed element, for each symbol that it may alias to. If for any symbol we can’t compute it, return None.
- get_
referred_ symbol - Return Symbol referred by
val
if there is exactly one symbol referred, orNone
if there are no Symbols referred or if there is more then one referred. - get_
referred_ symbols - Get Symbols, both Symbol::Locals and Symbol::Args, reachable
from the
val
via chain of InstOp::GetElemPtr (GEP) instructions or via InstOp::IntToPtr and InstOp::PtrToInt instruction patterns specific to references, both referencing (&
) and dereferencing (*
), and raw pointers, via__addr_of
. Aval
can, via these instructions, refer indirectly to none, or one or more symbols. - get_
stored_ ptr_ values - Pointers that may possibly be stored to the instruction
inst
. - get_
stored_ symbols - Symbols that may possibly, directly or indirectly, be stored to the instruction
inst
. - may_
alias - Can memory ranges [val1, val1+len1] and [val2, val2+len2] overlap? Conservatively returns true if cannot statically determine.
- must_
alias - Are memory ranges [val1, val1+len1] and [val2, val2+len2] exactly the same? Conservatively returns false if cannot statically determine.
- pointee_
size - For a pointer argument
ptr_val
, what’s the size of its pointee.