LLVM 19.0.0git
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...
 
enum  ImportKind : unsigned { Definition = 0 , Declaration = 1 }
 

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.
 
void setOriginalName (GlobalValue::GUID Name)
 Initialize the original name hash in this summary.
 
SummaryKind getSummaryKind () const
 Which kind of summary subclass this is.
 
void setModulePath (StringRef ModPath)
 Set the path to the module containing this function, for use in the combined index.
 
StringRef modulePath () const
 Get the path to the module containing this function.
 
GVFlags flags () const
 Get the flags for this GlobalValue (see struct GVFlags).
 
GlobalValue::LinkageTypes linkage () const
 Return linkage type recorded for this global value.
 
void setLinkage (GlobalValue::LinkageTypes Linkage)
 Sets the linkage to the value determined by global summary-based optimization.
 
bool notEligibleToImport () const
 Return true if this global value can't be imported.
 
bool isLive () const
 
void setLive (bool Live)
 
void setDSOLocal (bool Local)
 
bool isDSOLocal () const
 
void setCanAutoHide (bool CanAutoHide)
 
bool canAutoHide () const
 
bool shouldImportAsDecl () const
 
void setImportKind (ImportKind IK)
 
GlobalValueSummary::ImportKind importType () const
 
GlobalValue::VisibilityTypes getVisibility () const
 
void setVisibility (GlobalValue::VisibilityTypes Vis)
 
void setNotEligibleToImport ()
 Flag that this global value cannot be imported.
 
ArrayRef< ValueInforefs () const
 Return the list of values referenced by this global value definition.
 
GlobalValueSummarygetBaseObject ()
 If this is an alias summary, returns the summary of the aliased object (a global variable or function), otherwise returns itself.
 
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 445 of file ModuleSummaryIndex.h.

Member Enumeration Documentation

◆ ImportKind

Enumerator
Definition 
Declaration 

Definition at line 450 of file ModuleSummaryIndex.h.

◆ SummaryKind

Sububclass discriminator (for dyn_cast<> et al.)

Enumerator
AliasKind 
FunctionKind 
GlobalVarKind 

Definition at line 448 of file ModuleSummaryIndex.h.

Constructor & Destructor Documentation

◆ GlobalValueSummary()

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

Definition at line 544 of file ModuleSummaryIndex.h.

References AliasKind, and assert().

◆ ~GlobalValueSummary()

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

Member Function Documentation

◆ canAutoHide()

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

Definition at line 597 of file ModuleSummaryIndex.h.

◆ flags()

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

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

Definition at line 571 of file ModuleSummaryIndex.h.

◆ 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 689 of file ModuleSummaryIndex.h.

Referenced by llvm::ModuleSummaryIndex::canImportGlobalVar().

◆ getBaseObject() [2/2]

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

Definition at line 683 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 555 of file ModuleSummaryIndex.h.

◆ getSummaryKind()

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

Which kind of summary subclass this is.

Definition at line 561 of file ModuleSummaryIndex.h.

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

◆ getVisibility()

GlobalValue::VisibilityTypes llvm::GlobalValueSummary::getVisibility ( ) const
inline

Definition at line 609 of file ModuleSummaryIndex.h.

◆ importType()

GlobalValueSummary::ImportKind llvm::GlobalValueSummary::importType ( ) const
inline

Definition at line 605 of file ModuleSummaryIndex.h.

◆ isDSOLocal()

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

Definition at line 593 of file ModuleSummaryIndex.h.

◆ isLive()

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

Definition at line 587 of file ModuleSummaryIndex.h.

Referenced by llvm::ModuleSummaryIndex::isGlobalValueLive().

◆ linkage()

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

Return linkage type recorded for this global value.

Definition at line 574 of file ModuleSummaryIndex.h.

Referenced by llvm::ModuleSummaryIndex::canImportGlobalVar(), llvm::JITSymbolFlags::fromSummary(), and getNodeLabel().

◆ modulePath()

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

Get the path to the module containing this function.

Definition at line 568 of file ModuleSummaryIndex.h.

Referenced by computeImportForFunction().

◆ notEligibleToImport()

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

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

Definition at line 585 of file ModuleSummaryIndex.h.

Referenced by llvm::ModuleSummaryIndex::canImportGlobalVar().

◆ refs()

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

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

Definition at line 620 of file ModuleSummaryIndex.h.

Referenced by propagateAttributesToRefs(), and llvm::FunctionSummary::specialRefCounts().

◆ setCanAutoHide()

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

Definition at line 595 of file ModuleSummaryIndex.h.

◆ setDSOLocal()

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

Definition at line 591 of file ModuleSummaryIndex.h.

◆ setImportKind()

void llvm::GlobalValueSummary::setImportKind ( ImportKind  IK)
inline

Definition at line 603 of file ModuleSummaryIndex.h.

◆ 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 580 of file ModuleSummaryIndex.h.

◆ setLive()

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

Definition at line 589 of file ModuleSummaryIndex.h.

References 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 565 of file ModuleSummaryIndex.h.

◆ setNotEligibleToImport()

void llvm::GlobalValueSummary::setNotEligibleToImport ( )
inline

Flag that this global value cannot be imported.

Definition at line 617 of file ModuleSummaryIndex.h.

◆ setOriginalName()

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

Initialize the original name hash in this summary.

Definition at line 558 of file ModuleSummaryIndex.h.

References Name.

◆ setVisibility()

void llvm::GlobalValueSummary::setVisibility ( GlobalValue::VisibilityTypes  Vis)
inline

Definition at line 612 of file ModuleSummaryIndex.h.

◆ shouldImportAsDecl()

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

Definition at line 599 of file ModuleSummaryIndex.h.

References Declaration.

Friends And Related Function Documentation

◆ ModuleSummaryIndex

friend class ModuleSummaryIndex
friend

Definition at line 627 of file ModuleSummaryIndex.h.


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