LLVM  8.0.0svn
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
llvm::FunctionSummary Class Reference

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

#include "llvm/IR/ModuleSummaryIndex.h"

Inheritance diagram for llvm::FunctionSummary:
Inheritance graph
[legend]
Collaboration diagram for llvm::FunctionSummary:
Collaboration graph
[legend]

Classes

struct  ConstVCall
 A specification for a virtual function call with all constant integer arguments. More...
 
struct  FFlags
 Function attribute flags. More...
 
struct  TypeIdInfo
 All type identifier related information. More...
 
struct  VFuncId
 An "identifier" for a virtual function. More...
 

Public Types

enum  ForceSummaryHotnessType : unsigned { FSHT_None, FSHT_AllNonCritical, FSHT_All }
 Types for -force-summary-edges-cold debugging option. More...
 
using EdgeTy = std::pair< ValueInfo, CalleeInfo >
 <CalleeValueInfo, CalleeInfo> call edge pair. More...
 
- Public Types inherited from llvm::GlobalValueSummary
enum  SummaryKind : unsigned { AliasKind, FunctionKind, GlobalVarKind }
 Sububclass discriminator (for dyn_cast<> et al.) More...
 

Public Member Functions

 FunctionSummary (GVFlags Flags, unsigned NumInsts, FFlags FunFlags, std::vector< ValueInfo > Refs, std::vector< EdgeTy > CGEdges, std::vector< GlobalValue::GUID > TypeTests, std::vector< VFuncId > TypeTestAssumeVCalls, std::vector< VFuncId > TypeCheckedLoadVCalls, std::vector< ConstVCall > TypeTestAssumeConstVCalls, std::vector< ConstVCall > TypeCheckedLoadConstVCalls)
 
FFlags fflags () const
 Get function attribute flags. More...
 
unsigned instCount () const
 Get the instruction count recorded for this function. More...
 
ArrayRef< EdgeTycalls () const
 Return the list of <CalleeValueInfo, CalleeInfo> pairs. More...
 
ArrayRef< GlobalValue::GUIDtype_tests () const
 Returns the list of type identifiers used by this function in llvm.type.test intrinsics other than by an llvm.assume intrinsic, represented as GUIDs. More...
 
ArrayRef< VFuncIdtype_test_assume_vcalls () const
 Returns the list of virtual calls made by this function using llvm.assume(llvm.type.test) intrinsics that do not have all constant integer arguments. More...
 
ArrayRef< VFuncIdtype_checked_load_vcalls () const
 Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics that do not have all constant integer arguments. More...
 
ArrayRef< ConstVCalltype_test_assume_const_vcalls () const
 Returns the list of virtual calls made by this function using llvm.assume(llvm.type.test) intrinsics with all constant integer arguments. More...
 
ArrayRef< ConstVCalltype_checked_load_const_vcalls () const
 Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics with all constant integer arguments. More...
 
void addTypeTest (GlobalValue::GUID Guid)
 Add a type test to the summary. More...
 
const TypeIdInfogetTypeIdInfo () const
 
- Public Member Functions inherited from llvm::GlobalValueSummary
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 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
 

Static Public Member Functions

static FunctionSummary makeDummyFunctionSummary (std::vector< FunctionSummary::EdgeTy > Edges)
 Create an empty FunctionSummary (with specified call edges). More...
 
static bool classof (const GlobalValueSummary *GVS)
 Check if this is a function summary. More...
 

Static Public Attributes

static FunctionSummary ExternalNode
 A dummy node to reference external functions that aren't in the index. More...
 

Friends

struct GraphTraits< ValueInfo >
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::GlobalValueSummary
 GlobalValueSummary (SummaryKind K, GVFlags Flags, std::vector< ValueInfo > Refs)
 

Detailed Description

Function summary information to aid decisions and implementation of importing.

Definition at line 430 of file ModuleSummaryIndex.h.

Member Typedef Documentation

◆ EdgeTy

<CalleeValueInfo, CalleeInfo> call edge pair.

Definition at line 433 of file ModuleSummaryIndex.h.

Member Enumeration Documentation

◆ ForceSummaryHotnessType

Types for -force-summary-edges-cold debugging option.

Enumerator
FSHT_None 
FSHT_AllNonCritical 
FSHT_All 

Definition at line 436 of file ModuleSummaryIndex.h.

Constructor & Destructor Documentation

◆ FunctionSummary()

llvm::FunctionSummary::FunctionSummary ( GVFlags  Flags,
unsigned  NumInsts,
FFlags  FunFlags,
std::vector< ValueInfo Refs,
std::vector< EdgeTy CGEdges,
std::vector< GlobalValue::GUID TypeTests,
std::vector< VFuncId TypeTestAssumeVCalls,
std::vector< VFuncId TypeCheckedLoadVCalls,
std::vector< ConstVCall TypeTestAssumeConstVCalls,
std::vector< ConstVCall TypeCheckedLoadConstVCalls 
)
inline

Definition at line 522 of file ModuleSummaryIndex.h.

Member Function Documentation

◆ addTypeTest()

void llvm::FunctionSummary::addTypeTest ( GlobalValue::GUID  Guid)
inline

Add a type test to the summary.

This is used by WholeProgramDevirt if we were unable to devirtualize a checked call.

Definition at line 602 of file ModuleSummaryIndex.h.

◆ calls()

ArrayRef<EdgeTy> llvm::FunctionSummary::calls ( ) const
inline

Return the list of <CalleeValueInfo, CalleeInfo> pairs.

Definition at line 554 of file ModuleSummaryIndex.h.

Referenced by computeImportForFunction(), llvm::ModuleSummaryIndex::discoverNodes(), getLinkageNameWithSpace(), and writeTypeIdSummaryRecord().

◆ classof()

static bool llvm::FunctionSummary::classof ( const GlobalValueSummary GVS)
inlinestatic

Check if this is a function summary.

Definition at line 543 of file ModuleSummaryIndex.h.

References llvm::GlobalValueSummary::getSummaryKind().

◆ fflags()

FFlags llvm::FunctionSummary::fflags ( ) const
inline

Get function attribute flags.

Definition at line 548 of file ModuleSummaryIndex.h.

Referenced by getLinkageNameWithSpace(), and writeTypeIdSummaryRecord().

◆ getTypeIdInfo()

const TypeIdInfo* llvm::FunctionSummary::getTypeIdInfo ( ) const
inline

Definition at line 608 of file ModuleSummaryIndex.h.

Referenced by getLinkageNameWithSpace().

◆ instCount()

unsigned llvm::FunctionSummary::instCount ( ) const
inline

Get the instruction count recorded for this function.

Definition at line 551 of file ModuleSummaryIndex.h.

Referenced by ComputeImportForModule(), getLinkageNameWithSpace(), and writeTypeIdSummaryRecord().

◆ makeDummyFunctionSummary()

static FunctionSummary llvm::FunctionSummary::makeDummyFunctionSummary ( std::vector< FunctionSummary::EdgeTy Edges)
inlinestatic

Create an empty FunctionSummary (with specified call edges).

Used to represent external nodes and the dummy root node.

Definition at line 491 of file ModuleSummaryIndex.h.

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

◆ type_checked_load_const_vcalls()

ArrayRef<ConstVCall> llvm::FunctionSummary::type_checked_load_const_vcalls ( ) const
inline

Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics with all constant integer arguments.

Definition at line 594 of file ModuleSummaryIndex.h.

Referenced by writeFunctionTypeMetadataRecords().

◆ type_checked_load_vcalls()

ArrayRef<VFuncId> llvm::FunctionSummary::type_checked_load_vcalls ( ) const
inline

Returns the list of virtual calls made by this function using llvm.type.checked.load intrinsics that do not have all constant integer arguments.

Definition at line 577 of file ModuleSummaryIndex.h.

Referenced by writeFunctionTypeMetadataRecords().

◆ type_test_assume_const_vcalls()

ArrayRef<ConstVCall> llvm::FunctionSummary::type_test_assume_const_vcalls ( ) const
inline

Returns the list of virtual calls made by this function using llvm.assume(llvm.type.test) intrinsics with all constant integer arguments.

Definition at line 586 of file ModuleSummaryIndex.h.

Referenced by writeFunctionTypeMetadataRecords().

◆ type_test_assume_vcalls()

ArrayRef<VFuncId> llvm::FunctionSummary::type_test_assume_vcalls ( ) const
inline

Returns the list of virtual calls made by this function using llvm.assume(llvm.type.test) intrinsics that do not have all constant integer arguments.

Definition at line 568 of file ModuleSummaryIndex.h.

Referenced by writeFunctionTypeMetadataRecords().

◆ type_tests()

ArrayRef<GlobalValue::GUID> llvm::FunctionSummary::type_tests ( ) const
inline

Returns the list of type identifiers used by this function in llvm.type.test intrinsics other than by an llvm.assume intrinsic, represented as GUIDs.

Definition at line 559 of file ModuleSummaryIndex.h.

Referenced by writeFunctionTypeMetadataRecords().

Friends And Related Function Documentation

◆ GraphTraits< ValueInfo >

friend struct GraphTraits< ValueInfo >
friend

Definition at line 608 of file ModuleSummaryIndex.h.

Member Data Documentation

◆ ExternalNode

FunctionSummary FunctionSummary::ExternalNode
static
Initial value:

A dummy node to reference external functions that aren't in the index.

Definition at line 505 of file ModuleSummaryIndex.h.

Referenced by llvm::GraphTraits< ValueInfo >::child_begin(), and llvm::GraphTraits< ValueInfo >::child_end().


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