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

Member Enumeration Documentation

◆ Flags

Enumerator
HaveGV 
ReadOnly 
WriteOnly 

Definition at line 200 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 205 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 68 of file ModuleSummaryIndex.cpp.

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

◆ getAccessSpecifier()

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

Definition at line 241 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 43 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 212 of file ModuleSummaryIndex.h.

References getRef().

◆ getRef()

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

Definition at line 260 of file ModuleSummaryIndex.h.

References RefAndFlags.

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

◆ getSummaryList()

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

◆ getValue()

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

Definition at line 213 of file ModuleSummaryIndex.h.

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

Referenced by hasName().

◆ hasName()

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

Definition at line 224 of file ModuleSummaryIndex.h.

References getValue(), and haveGVs().

◆ haveGVs()

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

Definition at line 232 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 55 of file ModuleSummaryIndex.cpp.

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

◆ isReadOnly()

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

Definition at line 233 of file ModuleSummaryIndex.h.

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

Referenced by resolveFwdRef().

◆ isValidAccessSpecifier()

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

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

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

Referenced by resolveFwdRef().

◆ name()

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

Definition at line 226 of file ModuleSummaryIndex.h.

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

◆ operator bool()

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

Definition at line 210 of file ModuleSummaryIndex.h.

References getRef().

◆ setReadOnly()

void llvm::ValueInfo::setReadOnly ( )
inline

Definition at line 249 of file ModuleSummaryIndex.h.

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

Referenced by resolveFwdRef().

◆ setWriteOnly()

void llvm::ValueInfo::setWriteOnly ( )
inline

Definition at line 255 of file ModuleSummaryIndex.h.

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

Referenced by resolveFwdRef().

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: