LLVM 22.0.0git
llvm::ValueInfo Struct Reference

Struct that holds a reference to a particular GUID in a global value summary. More...

#include "llvm/IR/ModuleSummaryIndex.h"

Public Types

enum  Flags { HaveGV = 1 , ReadOnly = 2 , WriteOnly = 4 }

Public Member Functions

 ValueInfo ()=default
 ValueInfo (bool HaveGVs, const GlobalValueSummaryMapTy::value_type *R)
 operator bool () const
GlobalValue::GUID getGUID () const
const GlobalValuegetValue () const
ArrayRef< std::unique_ptr< GlobalValueSummary > > getSummaryList () const
void verifyLocal () const
bool hasLocal () const
bool hasName () const
StringRef name () const
bool haveGVs () const
bool isReadOnly () const
bool isWriteOnly () const
unsigned getAccessSpecifier () const
bool isValidAccessSpecifier () const
void setReadOnly ()
void setWriteOnly ()
const GlobalValueSummaryMapTy::value_type * getRef () const
LLVM_ABI GlobalValue::VisibilityTypes getELFVisibility () const
 Returns the most constraining visibility among summaries.
LLVM_ABI bool isDSOLocal (bool WithDSOLocalPropagation=false) const
 Checks if all summaries are DSO local (have the flag set).
LLVM_ABI bool canAutoHide () const
 Checks if all copies are eligible for auto-hiding (have flag set).

Public Attributes

PointerIntPair< const GlobalValueSummaryMapTy::value_type *, 3, int > RefAndFlags

Detailed Description

Struct that holds a reference to a particular GUID in a global value summary.

Definition at line 219 of file ModuleSummaryIndex.h.

Member Enumeration Documentation

◆ Flags

Enumerator
HaveGV 
ReadOnly 
WriteOnly 

Definition at line 220 of file ModuleSummaryIndex.h.

Constructor & Destructor Documentation

◆ ValueInfo() [1/2]

llvm::ValueInfo::ValueInfo ( )
default

◆ ValueInfo() [2/2]

llvm::ValueInfo::ValueInfo ( bool HaveGVs,
const GlobalValueSummaryMapTy::value_type * R )
inline

Definition at line 225 of file ModuleSummaryIndex.h.

References RefAndFlags.

Member Function Documentation

◆ canAutoHide()

bool ValueInfo::canAutoHide ( ) const

Checks if all copies are eligible for auto-hiding (have flag set).

Definition at line 66 of file ModuleSummaryIndex.cpp.

References llvm::all_of(), and getSummaryList().

◆ getAccessSpecifier()

unsigned llvm::ValueInfo::getAccessSpecifier ( ) const
inline

Definition at line 265 of file ModuleSummaryIndex.h.

References assert(), isValidAccessSpecifier(), ReadOnly, RefAndFlags, and WriteOnly.

Referenced by setReadOnly(), and setWriteOnly().

◆ getELFVisibility()

GlobalValue::VisibilityTypes ValueInfo::getELFVisibility ( ) const

Returns the most constraining visibility among summaries.

The visibilities, ordered from least to most constraining, are: default, protected and hidden.

Definition at line 41 of file ModuleSummaryIndex.cpp.

References llvm::GlobalValue::DefaultVisibility, getSummaryList(), llvm::GlobalValue::HiddenVisibility, llvm::make_pointee_range(), and llvm::GlobalValue::ProtectedVisibility.

◆ getGUID()

GlobalValue::GUID llvm::ValueInfo::getGUID ( ) const
inline

Definition at line 232 of file ModuleSummaryIndex.h.

References getRef().

◆ getRef()

const GlobalValueSummaryMapTy::value_type * llvm::ValueInfo::getRef ( ) const
inline

Definition at line 284 of file ModuleSummaryIndex.h.

References RefAndFlags.

Referenced by getGUID(), getSummaryList(), getValue(), hasLocal(), name(), operator bool(), and verifyLocal().

◆ getSummaryList()

ArrayRef< std::unique_ptr< GlobalValueSummary > > llvm::ValueInfo::getSummaryList ( ) const
inline

◆ getValue()

const GlobalValue * llvm::ValueInfo::getValue ( ) const
inline

Definition at line 233 of file ModuleSummaryIndex.h.

References assert(), getRef(), and haveGVs().

Referenced by hasName().

◆ hasLocal()

bool llvm::ValueInfo::hasLocal ( ) const
inline

Definition at line 244 of file ModuleSummaryIndex.h.

References getRef().

◆ hasName()

bool llvm::ValueInfo::hasName ( ) const
inline

Definition at line 248 of file ModuleSummaryIndex.h.

References getValue(), and haveGVs().

◆ haveGVs()

bool llvm::ValueInfo::haveGVs ( ) const
inline

Definition at line 256 of file ModuleSummaryIndex.h.

References HaveGV, and RefAndFlags.

Referenced by getValue(), hasName(), and name().

◆ isDSOLocal()

bool ValueInfo::isDSOLocal ( bool WithDSOLocalPropagation = false) const

Checks if all summaries are DSO local (have the flag set).

When DSOLocal propagation has been done, set the parameter to enable fast check.

Definition at line 53 of file ModuleSummaryIndex.cpp.

References llvm::all_of(), and getSummaryList().

◆ isReadOnly()

bool llvm::ValueInfo::isReadOnly ( ) const
inline

Definition at line 257 of file ModuleSummaryIndex.h.

References assert(), isValidAccessSpecifier(), ReadOnly, and RefAndFlags.

Referenced by resolveFwdRef().

◆ isValidAccessSpecifier()

bool llvm::ValueInfo::isValidAccessSpecifier ( ) const
inline

Definition at line 269 of file ModuleSummaryIndex.h.

References ReadOnly, RefAndFlags, and WriteOnly.

Referenced by getAccessSpecifier(), isReadOnly(), and isWriteOnly().

◆ isWriteOnly()

bool llvm::ValueInfo::isWriteOnly ( ) const
inline

Definition at line 261 of file ModuleSummaryIndex.h.

References assert(), isValidAccessSpecifier(), RefAndFlags, and WriteOnly.

Referenced by resolveFwdRef().

◆ name()

StringRef llvm::ValueInfo::name ( ) const
inline

Definition at line 250 of file ModuleSummaryIndex.h.

References assert(), getRef(), and haveGVs().

◆ operator bool()

llvm::ValueInfo::operator bool ( ) const
inlineexplicit

Definition at line 230 of file ModuleSummaryIndex.h.

References getRef().

◆ setReadOnly()

void llvm::ValueInfo::setReadOnly ( )
inline

Definition at line 273 of file ModuleSummaryIndex.h.

References assert(), getAccessSpecifier(), ReadOnly, and RefAndFlags.

Referenced by resolveFwdRef().

◆ setWriteOnly()

void llvm::ValueInfo::setWriteOnly ( )
inline

Definition at line 279 of file ModuleSummaryIndex.h.

References assert(), getAccessSpecifier(), RefAndFlags, and WriteOnly.

Referenced by resolveFwdRef().

◆ verifyLocal()

void llvm::ValueInfo::verifyLocal ( ) const
inline

Definition at line 242 of file ModuleSummaryIndex.h.

References getRef().

Member Data Documentation

◆ RefAndFlags

PointerIntPair<const GlobalValueSummaryMapTy::value_type *, 3, int> llvm::ValueInfo::RefAndFlags

The documentation for this struct was generated from the following files: