LLVM  9.0.0svn
Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::GlobalValueSummary Class Reference

Function and variable summary information to aid decisions and implementation of importing. More...

#include "llvm/IR/ModuleSummaryIndex.h"

Inheritance diagram for llvm::GlobalValueSummary:
Inheritance graph
[legend]

Classes

struct  GVFlags
 Group flags (Linkage, NotEligibleToImport, etc.) as a bitfield. More...
 

Public Types

enum  SummaryKind : unsigned { AliasKind, FunctionKind, GlobalVarKind }
 Sububclass discriminator (for dyn_cast<> et al.) More...
 

Public Member Functions

virtual ~GlobalValueSummary ()=default
 
GlobalValue::GUID getOriginalName () const
 Returns the hash of the original name, it is identical to the GUID for externally visible symbols, but not for local ones. More...
 
void setOriginalName (GlobalValue::GUID Name)
 Initialize the original name hash in this summary. More...
 
SummaryKind getSummaryKind () const
 Which kind of summary subclass this is. More...
 
void setModulePath (StringRef ModPath)
 Set the path to the module containing this function, for use in the combined index. More...
 
StringRef modulePath () const
 Get the path to the module containing this function. More...
 
GVFlags flags () const
 Get the flags for this GlobalValue (see struct GVFlags). More...
 
GlobalValue::LinkageTypes linkage () const
 Return linkage type recorded for this global value. More...
 
void setLinkage (GlobalValue::LinkageTypes Linkage)
 Sets the linkage to the value determined by global summary-based optimization. More...
 
bool notEligibleToImport () const
 Return true if this global value can't be imported. More...
 
bool isLive () const
 
void setLive (bool Live)
 
void setDSOLocal (bool Local)
 
bool isDSOLocal () const
 
void setCanAutoHide (bool CanAutoHide)
 
bool canAutoHide () const
 
void setNotEligibleToImport ()
 Flag that this global value cannot be imported. More...
 
ArrayRef< ValueInforefs () const
 Return the list of values referenced by this global value definition. More...
 
GlobalValueSummarygetBaseObject ()
 If this is an alias summary, returns the summary of the aliased object (a global variable or function), otherwise returns itself. More...
 
const GlobalValueSummarygetBaseObject () const
 

Protected Member Functions

 GlobalValueSummary (SummaryKind K, GVFlags Flags, std::vector< ValueInfo > Refs)
 

Friends

class ModuleSummaryIndex
 

Detailed Description

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

Definition at line 254 of file ModuleSummaryIndex.h.

Member Enumeration Documentation

◆ SummaryKind

Sububclass discriminator (for dyn_cast<> et al.)

Enumerator
AliasKind 
FunctionKind 
GlobalVarKind 

Definition at line 257 of file ModuleSummaryIndex.h.

Constructor & Destructor Documentation

◆ GlobalValueSummary()

llvm::GlobalValueSummary::GlobalValueSummary ( SummaryKind  K,
GVFlags  Flags,
std::vector< ValueInfo Refs 
)
inlineprotected

Definition at line 331 of file ModuleSummaryIndex.h.

References assert().

◆ ~GlobalValueSummary()

virtual llvm::GlobalValueSummary::~GlobalValueSummary ( )
virtualdefault

Member Function Documentation

◆ canAutoHide()

bool llvm::GlobalValueSummary::canAutoHide ( ) const
inline

◆ flags()

GVFlags llvm::GlobalValueSummary::flags ( ) const
inline

Get the flags for this GlobalValue (see struct GVFlags).

Definition at line 358 of file ModuleSummaryIndex.h.

Referenced by getLinkageNameWithSpace(), and writeTypeIdSummaryRecord().

◆ getBaseObject() [1/2]

GlobalValueSummary * llvm::GlobalValueSummary::getBaseObject ( )
inline

If this is an alias summary, returns the summary of the aliased object (a global variable or function), otherwise returns itself.

Definition at line 457 of file ModuleSummaryIndex.h.

Referenced by llvm::canImportGlobalVar(), and isWeakWriteableObject().

◆ getBaseObject() [2/2]

const GlobalValueSummary * llvm::GlobalValueSummary::getBaseObject ( ) const
inline

Definition at line 451 of file ModuleSummaryIndex.h.

◆ getOriginalName()

GlobalValue::GUID llvm::GlobalValueSummary::getOriginalName ( ) const
inline

Returns the hash of the original name, it is identical to the GUID for externally visible symbols, but not for local ones.

Definition at line 342 of file ModuleSummaryIndex.h.

◆ getSummaryKind()

SummaryKind llvm::GlobalValueSummary::getSummaryKind ( ) const
inline

Which kind of summary subclass this is.

Definition at line 348 of file ModuleSummaryIndex.h.

Referenced by llvm::AliasSummary::classof(), llvm::FunctionSummary::classof(), llvm::GlobalVarSummary::classof(), and getLinkageNameWithSpace().

◆ isDSOLocal()

bool llvm::GlobalValueSummary::isDSOLocal ( ) const
inline

Definition at line 380 of file ModuleSummaryIndex.h.

References llvm::GlobalValueSummary::GVFlags::DSOLocal.

◆ isLive()

bool llvm::GlobalValueSummary::isLive ( ) const
inline

◆ linkage()

GlobalValue::LinkageTypes llvm::GlobalValueSummary::linkage ( ) const
inline

Return linkage type recorded for this global value.

Definition at line 361 of file ModuleSummaryIndex.h.

References llvm::GlobalValueSummary::GVFlags::Linkage.

Referenced by llvm::canImportGlobalVar(), and getNodeLabel().

◆ modulePath()

StringRef llvm::GlobalValueSummary::modulePath ( ) const
inline

◆ notEligibleToImport()

bool llvm::GlobalValueSummary::notEligibleToImport ( ) const
inline

Return true if this global value can't be imported.

Definition at line 372 of file ModuleSummaryIndex.h.

References llvm::GlobalValueSummary::GVFlags::NotEligibleToImport.

Referenced by llvm::canImportGlobalVar().

◆ refs()

ArrayRef<ValueInfo> llvm::GlobalValueSummary::refs ( ) const
inline

Return the list of values referenced by this global value definition.

Definition at line 390 of file ModuleSummaryIndex.h.

Referenced by llvm::canImportGlobalVar(), computeImportForFunction(), computeImportForReferencedGlobals(), getLinkageNameWithSpace(), propagateConstantsToRefs(), and writeTypeIdSummaryRecord().

◆ setCanAutoHide()

void llvm::GlobalValueSummary::setCanAutoHide ( bool  CanAutoHide)
inline

◆ setDSOLocal()

void llvm::GlobalValueSummary::setDSOLocal ( bool  Local)
inline

Definition at line 378 of file ModuleSummaryIndex.h.

References llvm::GlobalValueSummary::GVFlags::DSOLocal.

◆ setLinkage()

void llvm::GlobalValueSummary::setLinkage ( GlobalValue::LinkageTypes  Linkage)
inline

Sets the linkage to the value determined by global summary-based optimization.

Will be applied in the ThinLTO backends.

Definition at line 367 of file ModuleSummaryIndex.h.

References llvm::GlobalValueSummary::GVFlags::Linkage.

◆ setLive()

void llvm::GlobalValueSummary::setLive ( bool  Live)
inline

Definition at line 376 of file ModuleSummaryIndex.h.

References llvm::GlobalValueSummary::GVFlags::Live.

◆ setModulePath()

void llvm::GlobalValueSummary::setModulePath ( StringRef  ModPath)
inline

Set the path to the module containing this function, for use in the combined index.

Definition at line 352 of file ModuleSummaryIndex.h.

Referenced by setImmutableRefs().

◆ setNotEligibleToImport()

void llvm::GlobalValueSummary::setNotEligibleToImport ( )
inline

Flag that this global value cannot be imported.

Definition at line 387 of file ModuleSummaryIndex.h.

References llvm::GlobalValueSummary::GVFlags::NotEligibleToImport.

◆ setOriginalName()

void llvm::GlobalValueSummary::setOriginalName ( GlobalValue::GUID  Name)
inline

Initialize the original name hash in this summary.

Definition at line 345 of file ModuleSummaryIndex.h.

References Name.

Referenced by setImmutableRefs().

Friends And Related Function Documentation

◆ ModuleSummaryIndex

friend class ModuleSummaryIndex
friend

Definition at line 397 of file ModuleSummaryIndex.h.


The documentation for this class was generated from the following file: