LLVM  8.0.1
Classes | Typedefs | Functions | Variables
llvm::cflaa Namespace Reference

Classes

struct  AliasSummary
 AliasSummary is just a collection of ExternalRelation and ExternalAttribute. More...
 
class  CFLGraph
 The Program Expression Graph (PEG) of CFL analysis CFLGraph is auxiliary data structure used by CFL-based alias analysis to describe flow-insensitive pointer-related behaviors. More...
 
class  CFLGraphBuilder
 A builder class used to create CFLGraph instance from a given function The CFL-AA that uses this builder must provide its own type as a template argument. 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  FunctionHandle
 
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 callsite. 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. More...
 
typedef unsigned StratifiedIndex
 An index into Stratified Sets. More...
 

Functions

static const FunctionparentFunctionOfValue (const Value *Val)
 
AliasAttrs getAttrNone ()
 Attr represent whether the said pointer comes from an unknown source (such as opaque memory or an integer cast). More...
 
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). More...
 
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. More...
 
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. More...
 
bool hasEscapedAttr (AliasAttrs Attr)
 
static AliasAttr argNumberToAttr (unsigned ArgNum)
 
AliasAttrs getGlobalOrArgAttrFromValue (const Value &)
 AttrGlobal represent whether the said pointer is a global value. More...
 
bool isGlobalOrArgAttr (AliasAttrs Attr)
 
AliasAttrs getExternallyVisibleAttrs (AliasAttrs)
 Given an AliasAttrs, return a new AliasAttrs that only contains attributes meaningful to the caller. More...
 
Optional< InstantiatedValueinstantiateInterfaceValue (InterfaceValue IValue, CallSite CS)
 
Optional< InstantiatedRelationinstantiateExternalRelation (ExternalRelation ERelation, CallSite CS)
 
Optional< InstantiatedAttrinstantiateExternalAttribute (ExternalAttribute EAttr, CallSite CS)
 
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. More...
 
static const unsigned MaxSupportedArgsInSummary = 50
 The maximum number of arguments we can put into a summary. More...
 
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 59 of file AliasAnalysisSummary.h.

◆ StratifiedIndex

An index into Stratified Sets.

Definition at line 28 of file StratifiedSets.h.

Function Documentation

◆ addOffset()

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

Definition at line 142 of file AliasAnalysisSummary.h.

References UnknownOffset.

Referenced by getLeaOP().

◆ argNumberToAttr()

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

Definition at line 43 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 34 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 40 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 29 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 31 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 71 of file AliasAnalysisSummary.cpp.

Referenced by llvm::CFLSteensAAResult::FunctionInfo::FunctionInfo(), and populateExternalAttributes().

◆ 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 51 of file AliasAnalysisSummary.cpp.

References Arg, and argNumberToAttr().

◆ hasCallerAttr()

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

Definition at line 35 of file AliasAnalysisSummary.cpp.

◆ hasEscapedAttr()

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

Definition at line 41 of file AliasAnalysisSummary.cpp.

◆ hasUnknownAttr()

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

Definition at line 32 of file AliasAnalysisSummary.cpp.

◆ hasUnknownOrCallerAttr()

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

◆ instantiateExternalAttribute()

Optional< InstantiatedAttr > llvm::cflaa::instantiateExternalAttribute ( ExternalAttribute  EAttr,
CallSite  CS 
)

◆ instantiateExternalRelation()

Optional< InstantiatedRelation > llvm::cflaa::instantiateExternalRelation ( ExternalRelation  ERelation,
CallSite  CS 
)

◆ instantiateInterfaceValue()

Optional< InstantiatedValue > llvm::cflaa::instantiateInterfaceValue ( InterfaceValue  IValue,
CallSite  CS 
)

◆ isGlobalOrArgAttr()

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

◆ operator!=() [1/3]

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

Definition at line 120 of file AliasAnalysisSummary.h.

◆ operator!=() [2/3]

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

Definition at line 159 of file AliasAnalysisSummary.h.

◆ operator!=() [3/3]

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

Definition at line 209 of file AliasAnalysisSummary.h.

◆ operator<() [1/3]

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

◆ operator<() [2/3]

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

◆ operator<() [3/3]

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

◆ operator<=() [1/3]

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

Definition at line 130 of file AliasAnalysisSummary.h.

◆ operator<=() [2/3]

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

Definition at line 176 of file AliasAnalysisSummary.h.

◆ operator<=() [3/3]

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

Definition at line 219 of file AliasAnalysisSummary.h.

◆ operator==() [1/3]

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

◆ operator==() [2/3]

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

◆ operator==() [3/3]

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

◆ operator>() [1/3]

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

Definition at line 127 of file AliasAnalysisSummary.h.

◆ operator>() [2/3]

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

Definition at line 173 of file AliasAnalysisSummary.h.

◆ operator>() [3/3]

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

Definition at line 216 of file AliasAnalysisSummary.h.

◆ operator>=() [1/3]

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

Definition at line 133 of file AliasAnalysisSummary.h.

◆ operator>=() [2/3]

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

Definition at line 179 of file AliasAnalysisSummary.h.

◆ operator>=() [3/3]

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

Definition at line 222 of file AliasAnalysisSummary.h.

◆ parentFunctionOfValue()

static const Function* llvm::cflaa::parentFunctionOfValue ( const Value Val)
inlinestatic

Variable Documentation

◆ MaxSupportedArgsInSummary

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

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

Definition at line 102 of file AliasAnalysisSummary.h.

Referenced by llvm::CFLSteensAAResult::FunctionInfo::FunctionInfo().

◆ 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 54 of file AliasAnalysisSummary.h.

◆ UnknownOffset

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