Jlm
Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
jlm::llvm::CallSummary Class Referencefinal

#include <CallSummary.hpp>

Collaboration diagram for jlm::llvm::CallSummary:
Collaboration graph
[legend]

Public Member Functions

 CallSummary (rvsdg::GraphExport *rvsdgExport, std::vector< rvsdg::SimpleNode * > directCalls, std::vector< rvsdg::Input * > otherUsers)
 
bool IsDead () const noexcept
 
bool IsExported () const noexcept
 
bool IsOnlyExported () const noexcept
 
bool HasOnlyDirectCalls () const noexcept
 
bool HasNoOtherUsages () const noexcept
 
bool HasOnlyOtherUsages () const noexcept
 
size_t NumDirectCalls () const noexcept
 
size_t NumOtherUsers () const noexcept
 
rvsdg::GraphExportGetRvsdgExport () const noexcept
 
DirectCallsConstRange DirectCalls () const noexcept
 
OtherUsersConstRange OtherUsers () const noexcept
 

Static Public Member Functions

static std::unique_ptr< CallSummaryCreate (rvsdg::GraphExport *rvsdgExport, std::vector< rvsdg::SimpleNode * > directCalls, std::vector< rvsdg::Input * > otherUsers)
 

Private Types

using DirectCallsConstRange = util::IteratorRange< std::vector< rvsdg::SimpleNode * >::const_iterator >
 
using OtherUsersConstRange = util::IteratorRange< std::vector< rvsdg::Input * >::const_iterator >
 

Private Attributes

rvsdg::GraphExportRvsdgExport_
 
std::vector< rvsdg::SimpleNode * > DirectCalls_
 
std::vector< rvsdg::Input * > OtherUsers_
 

Detailed Description

The CallSummary of a lambda summarizes all call usages of the lambda. It distinguishes between three call usages:

  1. The export of the lambda, which is null if the lambda is not exported.
  2. All direct calls of the lambda.
  3. All other usages, e.g., indirect calls.

Definition at line 25 of file CallSummary.hpp.

Member Typedef Documentation

◆ DirectCallsConstRange

Definition at line 27 of file CallSummary.hpp.

◆ OtherUsersConstRange

using jlm::llvm::CallSummary::OtherUsersConstRange = util::IteratorRange<std::vector<rvsdg::Input *>::const_iterator>
private

Definition at line 29 of file CallSummary.hpp.

Constructor & Destructor Documentation

◆ CallSummary()

jlm::llvm::CallSummary::CallSummary ( rvsdg::GraphExport rvsdgExport,
std::vector< rvsdg::SimpleNode * >  directCalls,
std::vector< rvsdg::Input * >  otherUsers 
)
inline

Definition at line 32 of file CallSummary.hpp.

Member Function Documentation

◆ Create()

static std::unique_ptr<CallSummary> jlm::llvm::CallSummary::Create ( rvsdg::GraphExport rvsdgExport,
std::vector< rvsdg::SimpleNode * >  directCalls,
std::vector< rvsdg::Input * >  otherUsers 
)
inlinestatic

Creates a new CallSummary.

Parameters
rvsdgExportThe lambda export.
directCallsThe direct call sites of a lambda.
otherUsersAll other usages of a lambda.
Returns
A new CallSummary instance.
See also
ComputeCallSummary()

Definition at line 175 of file CallSummary.hpp.

◆ DirectCalls()

DirectCallsConstRange jlm::llvm::CallSummary::DirectCalls ( ) const
inlinenoexcept

Returns an util::IteratorRange for iterating through all direct call sites.

Returns
An util::IteratorRange of all direct call sites.

Definition at line 147 of file CallSummary.hpp.

◆ GetRvsdgExport()

rvsdg::GraphExport* jlm::llvm::CallSummary::GetRvsdgExport ( ) const
inlinenoexcept

Returns the export of the lambda.

Returns
The export of the lambda from the RVSDG root region.

Definition at line 136 of file CallSummary.hpp.

◆ HasNoOtherUsages()

bool jlm::llvm::CallSummary::HasNoOtherUsages ( ) const
inlinenoexcept

Determines whether the lambda has no other usages, i.e., it can only be exported and/or have direct calls.

Returns
True if the lambda has no other usages, otherwise false.

Definition at line 92 of file CallSummary.hpp.

◆ HasOnlyDirectCalls()

bool jlm::llvm::CallSummary::HasOnlyDirectCalls ( ) const
inlinenoexcept

Determines whether the lambda has only direct calls.

Returns
True if the lambda has only direct calls, otherwise false.

Definition at line 80 of file CallSummary.hpp.

◆ HasOnlyOtherUsages()

bool jlm::llvm::CallSummary::HasOnlyOtherUsages ( ) const
inlinenoexcept

Determines whether the lambda has only(!) other usages.

Returns
True if the lambda has only other usages, otherwise false.

Definition at line 103 of file CallSummary.hpp.

◆ IsDead()

bool jlm::llvm::CallSummary::IsDead ( ) const
inlinenoexcept

Determines whether the lambda is dead.

Returns
True if the lambda is dead, otherwise false.

Definition at line 47 of file CallSummary.hpp.

◆ IsExported()

bool jlm::llvm::CallSummary::IsExported ( ) const
inlinenoexcept

Determines whether the lambda is exported from the RVSDG

Returns
True if the lambda is exported, otherwise false.

Definition at line 58 of file CallSummary.hpp.

◆ IsOnlyExported()

bool jlm::llvm::CallSummary::IsOnlyExported ( ) const
inlinenoexcept

Determines whether the lambda is only(!) exported from the RVSDG.

Returns
True if the lambda is only exported, otherwise false.

Definition at line 69 of file CallSummary.hpp.

◆ NumDirectCalls()

size_t jlm::llvm::CallSummary::NumDirectCalls ( ) const
inlinenoexcept

Returns the number of direct call sites invoking the lambda.

Returns
The number of direct call sites.

Definition at line 114 of file CallSummary.hpp.

◆ NumOtherUsers()

size_t jlm::llvm::CallSummary::NumOtherUsers ( ) const
inlinenoexcept

Returns the number of all other users that are not direct calls.

Returns
The number of usages that are not direct calls.

Definition at line 125 of file CallSummary.hpp.

◆ OtherUsers()

OtherUsersConstRange jlm::llvm::CallSummary::OtherUsers ( ) const
inlinenoexcept

Returns an util::IteratorRange for iterating through all other usages.

Returns
An util::IteratorRange of all other usages.

Definition at line 158 of file CallSummary.hpp.

Member Data Documentation

◆ DirectCalls_

std::vector<rvsdg::SimpleNode *> jlm::llvm::CallSummary::DirectCalls_
private

Definition at line 188 of file CallSummary.hpp.

◆ OtherUsers_

std::vector<rvsdg::Input *> jlm::llvm::CallSummary::OtherUsers_
private

Definition at line 189 of file CallSummary.hpp.

◆ RvsdgExport_

rvsdg::GraphExport* jlm::llvm::CallSummary::RvsdgExport_
private

Definition at line 187 of file CallSummary.hpp.


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