llvm::GlobalVarSummary

Global variable summary information to aid decisions and implementation of importing.

Synopsis

Declared in <llvm/IR/ModuleSummaryIndex.h>

class GlobalVarSummary
    : public GlobalValueSummary

Description

Global variable summary has two extra flag, telling if it is readonly or writeonly. Both readonly and writeonly variables can be optimized in the backed: readonly variables can be const-folded, while writeonly vars can be completely eliminated together with corresponding stores. We let both things happen by means of internalizing such variables after ThinLTO import.

Base Classes

NameDescription
GlobalValueSummaryFunction and variable summary information to aid decisions and implementation of importing.

Types

NameDescription
GVFlags Group flags (Linkage, NotEligibleToImport, etc.) as a bitfield.
GVarFlags Global-variable-specific flags.

Enums

NameDescription
ImportKind Whether a value should be imported as a definition or a declaration.
SummaryKind Subclass discriminator (for dyn_cast<> et al.)

Member Functions

NameDescription
GlobalVarSummary [constructor]Construct a global variable summary.
canAutoHide Return true if this value can be auto-hidden.
flags Get the flags for this GlobalValue (see struct GVFlags).
getBaseObject getBaseObject overloads
getOriginalName Returns the hash of the original name, it is identical to the GUID for externally visible symbols, but not for local ones.
getSummaryKind Which kind of summary subclass this is.
getVCallVisibility Return the vcall visibility for a vtable definition.
getVisibility Return the visibility recorded for this global value.
importType Return whether this value should be imported as definition or declaration.
isConstant Return true if this variable is a compile-time constant.
isDSOLocal Return true if this symbol was resolved DSO-locally.
isLive Return true if this global value is live.
linkage Return linkage type recorded for this global value.
maybeReadOnly Return true if this variable may be read-only.
maybeWriteOnly Return true if this variable may be write-only.
modulePath Get the path to the module containing this function.
noRenameOnPromotion Return true if promotion must not rename this static global.
notEligibleToImport Return true if this global value can't be imported.
promote Promote this local symbol to external linkage and mark it promoted.
refs Return the list of values referenced by this global value definition.
setCanAutoHide Set whether this value can be auto-hidden.
setDSOLocal Set whether this symbol was resolved DSO-locally.
setExternalLinkageForTest Set external linkage for testing without going through promote().
setImportKind Set whether to import this value as a definition or declaration.
setLinkage Sets the linkage to the value determined by global summary-based optimization. Will be applied in the ThinLTO backends.
setLive Set whether this global value is live.
setModulePath Set the path to the module containing this function, for use in the combined index.
setNoRenameOnPromotion Set whether promotion must not rename this static global.
setNotEligibleToImport Flag that this global value cannot be imported.
setOriginalName Initialize the original name hash in this summary.
setReadOnly Set whether this variable may be read-only.
setVCallVisibility Set the vcall visibility for a vtable definition.
setVTableFuncs Record the list of functions referenced by this vtable definition.
setVisibility Set the visibility recorded for this global value.
setWriteOnly Set whether this variable may be write-only.
shouldImportAsDecl Return true if this value should be imported as a declaration.
vTableFuncs Return the functions referenced by this vtable definition, if any.
varflags Return the global-variable-specific flags.
wasPromoted Return true if this symbol was promoted from local linkage.

Static Member Functions

NameDescription
classof Check if this is a global variable summary.

Data Members

NameDescription
VarFlags Per-variable flags for this global variable summary.