LLVM 17.0.0git
Classes | Typedefs | Functions | Variables
llvm::cflaa Namespace Reference

Classes

struct  AliasSummary
 AliasSummary is just a collection of ExternalRelation and ExternalAttribute. More...
 
struct  ExternalAttribute
 We use ExternalAttribute to describe an externally visible AliasAttrs for parameters/return value. More...
 
struct  ExternalRelation
 We use ExternalRelation to describe an externally visible aliasing relations between parameters/return value of a function. More...
 
struct  InstantiatedAttr
 This is the result of instantiating ExternalAttribute at a particular callsite. More...
 
struct  InstantiatedRelation
 This is the result of instantiating ExternalRelation at a particular callsite. More...
 
struct  InstantiatedValue
 This is the result of instantiating InterfaceValue at a particular call. More...
 
struct  InterfaceValue
 We use InterfaceValue to describe parameters/return value, as well as potential memory locations that are pointed to by parameters/return value, of a function. More...
 
struct  StratifiedInfo
 NOTE: ^ This can't be a short – bootstrapping clang has a case where ~1M sets exist. More...
 
struct  StratifiedLink
 A "link" between two StratifiedSets. More...
 
class  StratifiedSets
 These are stratified sets, as described in "Fast algorithms for Dyck-CFL-reachability with applications to Alias Analysis" by Zhang Q, Lyu M R, Yuan H, and Su Z. More...
 
class  StratifiedSetsBuilder
 Generic Builder class that produces StratifiedSets instances. More...
 

Typedefs

typedef std::bitset< NumAliasAttrsAliasAttrs
 These are attributes that an alias analysis can use to mark certain special properties of a given pointer.
 
typedef unsigned StratifiedIndex
 An index into Stratified Sets.
 

Functions

AliasAttrs getAttrNone ()
 Attr represent whether the said pointer comes from an unknown source (such as opaque memory or an integer cast).
 
AliasAttrs getAttrUnknown ()
 AttrUnknown represent whether the said pointer comes from a source not known to alias analyses (such as opaque memory or an integer cast).
 
bool hasUnknownAttr (AliasAttrs Attr)
 
AliasAttrs getAttrCaller ()
 AttrCaller represent whether the said pointer comes from a source not known to the current function but known to the caller.
 
bool hasCallerAttr (AliasAttrs Attr)
 
bool hasUnknownOrCallerAttr (AliasAttrs Attr)
 
AliasAttrs getAttrEscaped ()
 AttrEscaped represent whether the said pointer comes from a known source but escapes to the unknown world (e.g.
 
bool hasEscapedAttr (AliasAttrs Attr)
 
static AliasAttr argNumberToAttr (unsigned ArgNum)
 
AliasAttrs getGlobalOrArgAttrFromValue (const Value &)
 AttrGlobal represent whether the said pointer is a global value.
 
bool isGlobalOrArgAttr (AliasAttrs Attr)
 
AliasAttrs getExternallyVisibleAttrs (AliasAttrs)
 Given an AliasAttrs, return a new AliasAttrs that only contains attributes meaningful to the caller.
 
std::optional< InstantiatedValueinstantiateInterfaceValue (InterfaceValue IValue, CallBase &Call)
 
std::optional< InstantiatedRelationinstantiateExternalRelation (ExternalRelation ERelation, CallBase &Call)
 
std::optional< InstantiatedAttrinstantiateExternalAttribute (ExternalAttribute EAttr, CallBase &Call)
 
bool operator== (InterfaceValue LHS, InterfaceValue RHS)
 
bool operator!= (InterfaceValue LHS, InterfaceValue RHS)
 
bool operator< (InterfaceValue LHS, InterfaceValue RHS)
 
bool operator> (InterfaceValue LHS, InterfaceValue RHS)
 
bool operator<= (InterfaceValue LHS, InterfaceValue RHS)
 
bool operator>= (InterfaceValue LHS, InterfaceValue RHS)
 
int64_t addOffset (int64_t LHS, int64_t RHS)
 
bool operator== (ExternalRelation LHS, ExternalRelation RHS)
 
bool operator!= (ExternalRelation LHS, ExternalRelation RHS)
 
bool operator< (ExternalRelation LHS, ExternalRelation RHS)
 
bool operator> (ExternalRelation LHS, ExternalRelation RHS)
 
bool operator<= (ExternalRelation LHS, ExternalRelation RHS)
 
bool operator>= (ExternalRelation LHS, ExternalRelation RHS)
 
bool operator== (InstantiatedValue LHS, InstantiatedValue RHS)
 
bool operator!= (InstantiatedValue LHS, InstantiatedValue RHS)
 
bool operator< (InstantiatedValue LHS, InstantiatedValue RHS)
 
bool operator> (InstantiatedValue LHS, InstantiatedValue RHS)
 
bool operator<= (InstantiatedValue LHS, InstantiatedValue RHS)
 
bool operator>= (InstantiatedValue LHS, InstantiatedValue RHS)
 

Variables

static const unsigned NumAliasAttrs = 32
 The number of attributes that AliasAttr should contain.
 
static const unsigned MaxSupportedArgsInSummary = 50
 The maximum number of arguments we can put into a summary.
 
static const int64_t UnknownOffset = INT64_MAX
 

Typedef Documentation

◆ AliasAttrs

typedef std::bitset<NumAliasAttrs> llvm::cflaa::AliasAttrs

These are attributes that an alias analysis can use to mark certain special properties of a given pointer.

Refer to the related functions below to see what kinds of attributes are currently defined.

Definition at line 61 of file AliasAnalysisSummary.h.

◆ StratifiedIndex

An index into Stratified Sets.

Definition at line 26 of file StratifiedSets.h.

Function Documentation

◆ addOffset()

int64_t llvm::cflaa::addOffset ( int64_t  LHS,
int64_t  RHS 
)
inline

Definition at line 144 of file AliasAnalysisSummary.h.

References LHS, RHS, and UnknownOffset.

◆ argNumberToAttr()

static AliasAttr llvm::cflaa::argNumberToAttr ( unsigned  ArgNum)
static

Definition at line 44 of file AliasAnalysisSummary.cpp.

Referenced by getGlobalOrArgAttrFromValue().

◆ getAttrCaller()

AliasAttrs llvm::cflaa::getAttrCaller ( )

AttrCaller represent whether the said pointer comes from a source not known to the current function but known to the caller.

Values pointed to by the arguments of the current function have this attribute set

Definition at line 35 of file AliasAnalysisSummary.cpp.

◆ getAttrEscaped()

AliasAttrs llvm::cflaa::getAttrEscaped ( )

AttrEscaped represent whether the said pointer comes from a known source but escapes to the unknown world (e.g.

casted to an integer, or passed as an argument to opaque function). Unlike non-escaped pointers, escaped ones may alias pointers coming from unknown sources.

Definition at line 41 of file AliasAnalysisSummary.cpp.

◆ getAttrNone()

AliasAttrs llvm::cflaa::getAttrNone ( )

Attr represent whether the said pointer comes from an unknown source (such as opaque memory or an integer cast).

Definition at line 30 of file AliasAnalysisSummary.cpp.

◆ getAttrUnknown()

AliasAttrs llvm::cflaa::getAttrUnknown ( )

AttrUnknown represent whether the said pointer comes from a source not known to alias analyses (such as opaque memory or an integer cast).

Definition at line 32 of file AliasAnalysisSummary.cpp.

◆ getExternallyVisibleAttrs()

AliasAttrs llvm::cflaa::getExternallyVisibleAttrs ( AliasAttrs  )

Given an AliasAttrs, return a new AliasAttrs that only contains attributes meaningful to the caller.

This function is primarily used for interprocedural analysis Currently, externally visible AliasAttrs include AttrUnknown, AttrGlobal, and AttrEscaped

Definition at line 72 of file AliasAnalysisSummary.cpp.

◆ getGlobalOrArgAttrFromValue()

AliasAttrs llvm::cflaa::getGlobalOrArgAttrFromValue ( const Value )

AttrGlobal represent whether the said pointer is a global value.

AttrArg represent whether the said pointer is an argument, and if so, what index the argument has.

Definition at line 52 of file AliasAnalysisSummary.cpp.

References Arg, and argNumberToAttr().

◆ hasCallerAttr()

bool llvm::cflaa::hasCallerAttr ( AliasAttrs  Attr)

Definition at line 36 of file AliasAnalysisSummary.cpp.

◆ hasEscapedAttr()

bool llvm::cflaa::hasEscapedAttr ( AliasAttrs  Attr)

Definition at line 42 of file AliasAnalysisSummary.cpp.

◆ hasUnknownAttr()

bool llvm::cflaa::hasUnknownAttr ( AliasAttrs  Attr)

Definition at line 33 of file AliasAnalysisSummary.cpp.

◆ hasUnknownOrCallerAttr()

bool llvm::cflaa::hasUnknownOrCallerAttr ( AliasAttrs  Attr)

Definition at line 37 of file AliasAnalysisSummary.cpp.

◆ instantiateExternalAttribute()

std::optional< InstantiatedAttr > llvm::cflaa::instantiateExternalAttribute ( ExternalAttribute  EAttr,
CallBase Call 
)

◆ instantiateExternalRelation()

std::optional< InstantiatedRelation > llvm::cflaa::instantiateExternalRelation ( ExternalRelation  ERelation,
CallBase Call 
)

◆ instantiateInterfaceValue()

std::optional< InstantiatedValue > llvm::cflaa::instantiateInterfaceValue ( InterfaceValue  IValue,
CallBase Call 
)

◆ isGlobalOrArgAttr()

bool llvm::cflaa::isGlobalOrArgAttr ( AliasAttrs  Attr)

Definition at line 65 of file AliasAnalysisSummary.cpp.

◆ operator!=() [1/3]

bool llvm::cflaa::operator!= ( ExternalRelation  LHS,
ExternalRelation  RHS 
)
inline

Definition at line 161 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator!=() [2/3]

bool llvm::cflaa::operator!= ( InstantiatedValue  LHS,
InstantiatedValue  RHS 
)
inline

Definition at line 212 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator!=() [3/3]

bool llvm::cflaa::operator!= ( InterfaceValue  LHS,
InterfaceValue  RHS 
)
inline

Definition at line 122 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator<() [1/3]

bool llvm::cflaa::operator< ( ExternalRelation  LHS,
ExternalRelation  RHS 
)
inline

Definition at line 164 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator<() [2/3]

bool llvm::cflaa::operator< ( InstantiatedValue  LHS,
InstantiatedValue  RHS 
)
inline

Definition at line 215 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator<() [3/3]

bool llvm::cflaa::operator< ( InterfaceValue  LHS,
InterfaceValue  RHS 
)
inline

Definition at line 125 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator<=() [1/3]

bool llvm::cflaa::operator<= ( ExternalRelation  LHS,
ExternalRelation  RHS 
)
inline

Definition at line 178 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator<=() [2/3]

bool llvm::cflaa::operator<= ( InstantiatedValue  LHS,
InstantiatedValue  RHS 
)
inline

Definition at line 222 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator<=() [3/3]

bool llvm::cflaa::operator<= ( InterfaceValue  LHS,
InterfaceValue  RHS 
)
inline

Definition at line 132 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator==() [1/3]

bool llvm::cflaa::operator== ( ExternalRelation  LHS,
ExternalRelation  RHS 
)
inline

Definition at line 158 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator==() [2/3]

bool llvm::cflaa::operator== ( InstantiatedValue  LHS,
InstantiatedValue  RHS 
)
inline

Definition at line 209 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator==() [3/3]

bool llvm::cflaa::operator== ( InterfaceValue  LHS,
InterfaceValue  RHS 
)
inline

Definition at line 119 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator>() [1/3]

bool llvm::cflaa::operator> ( ExternalRelation  LHS,
ExternalRelation  RHS 
)
inline

Definition at line 175 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator>() [2/3]

bool llvm::cflaa::operator> ( InstantiatedValue  LHS,
InstantiatedValue  RHS 
)
inline

Definition at line 219 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator>() [3/3]

bool llvm::cflaa::operator> ( InterfaceValue  LHS,
InterfaceValue  RHS 
)
inline

Definition at line 129 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator>=() [1/3]

bool llvm::cflaa::operator>= ( ExternalRelation  LHS,
ExternalRelation  RHS 
)
inline

Definition at line 181 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator>=() [2/3]

bool llvm::cflaa::operator>= ( InstantiatedValue  LHS,
InstantiatedValue  RHS 
)
inline

Definition at line 225 of file AliasAnalysisSummary.h.

References LHS, and RHS.

◆ operator>=() [3/3]

bool llvm::cflaa::operator>= ( InterfaceValue  LHS,
InterfaceValue  RHS 
)
inline

Definition at line 135 of file AliasAnalysisSummary.h.

References LHS, and RHS.

Variable Documentation

◆ MaxSupportedArgsInSummary

const unsigned llvm::cflaa::MaxSupportedArgsInSummary = 50
static

The maximum number of arguments we can put into a summary.

Definition at line 104 of file AliasAnalysisSummary.h.

◆ NumAliasAttrs

const unsigned llvm::cflaa::NumAliasAttrs = 32
static

The number of attributes that AliasAttr should contain.

Attributes are described below, and 32 was an arbitrary choice because it fits nicely in 32 bits (because we use a bitset for AliasAttr).

Definition at line 56 of file AliasAnalysisSummary.h.

◆ UnknownOffset

const int64_t llvm::cflaa::UnknownOffset = INT64_MAX
static

Definition at line 142 of file AliasAnalysisSummary.h.

Referenced by addOffset().