struct InstrProfRecord

Declaration

struct InstrProfRecord { /* full declaration omitted */ };

Description

Profiling information for a single function.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:725

Member Variables

public std::vector<uint64_t> Counts
private std::unique_ptr<ValueProfData> ValueData

Method Overview

  • public void Clear()
  • public InstrProfRecord(std::vector<uint64_t> Counts)
  • public InstrProfRecord(llvm::InstrProfRecord &&)
  • public InstrProfRecord(const llvm::InstrProfRecord & RHS)
  • public InstrProfRecord()
  • public void accumulateCounts(llvm::CountSumOrPercent & Sum) const
  • public void addValueData(uint32_t ValueKind, uint32_t Site, InstrProfValueData * VData, uint32_t N, llvm::InstrProfSymtab * SymTab)
  • public void clearValueData()
  • public inline uint32_t getNumValueData(uint32_t ValueKind) const
  • public inline uint32_t getNumValueDataForSite(uint32_t ValueKind, uint32_t Site) const
  • public inline uint32_t getNumValueKinds() const
  • public inline uint32_t getNumValueSites(uint32_t ValueKind) const
  • private std::vector<InstrProfValueSiteRecord> & getOrCreateValueSitesForKind(uint32_t ValueKind)
  • public inline std::unique_ptr<InstrProfValueData[]> getValueForSite(uint32_t ValueKind, uint32_t Site, uint64_t * TotalC = nullptr) const
  • public inline uint64_t getValueForSite(InstrProfValueData * Dest, uint32_t ValueKind, uint32_t Site) const
  • private ArrayRef<llvm::InstrProfValueSiteRecord> getValueSitesForKind(uint32_t ValueKind) const
  • private MutableArrayRef<llvm::InstrProfValueSiteRecord> getValueSitesForKind(uint32_t ValueKind)
  • public void merge(llvm::InstrProfRecord & Other, uint64_t Weight, function_ref<void (llvm::instrprof_error)> Warn)
  • private void mergeValueProfData(uint32_t ValkeKind, llvm::InstrProfRecord & Src, uint64_t Weight, function_ref<void (llvm::instrprof_error)> Warn)
  • public void overlap(llvm::InstrProfRecord & Other, llvm::OverlapStats & Overlap, llvm::OverlapStats & FuncLevelOverlap, uint64_t ValueCutoff)
  • public void overlapValueProfData(uint32_t ValueKind, llvm::InstrProfRecord & Src, llvm::OverlapStats & Overlap, llvm::OverlapStats & FuncLevelOverlap)
  • private uint64_t remapValue(uint64_t Value, uint32_t ValueKind, llvm::InstrProfSymtab * SymTab)
  • public inline void reserveSites(uint32_t ValueKind, uint32_t NumValueSites)
  • public void scale(uint64_t N, uint64_t D, function_ref<void (llvm::instrprof_error)> Warn)
  • private void scaleValueProfData(uint32_t ValueKind, uint64_t N, uint64_t D, function_ref<void (llvm::instrprof_error)> Warn)
  • public void sortValueData()

Methods

void Clear()

Description

Clear value data entries and edge counters.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:802

InstrProfRecord(std::vector<uint64_t> Counts)

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:729

Parameters

std::vector<uint64_t> Counts

InstrProfRecord(llvm::InstrProfRecord&&)

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:730

Parameters

llvm::InstrProfRecord&&

InstrProfRecord(const llvm::InstrProfRecord& RHS)

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:731

Parameters

const llvm::InstrProfRecord& RHS

InstrProfRecord()

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:728

void accumulateCounts(
    llvm::CountSumOrPercent& Sum) const

Description

Compute the sums of all counts and store in Sum.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:811

Parameters

llvm::CountSumOrPercent& Sum

void addValueData(uint32_t ValueKind,
                  uint32_t Site,
                  InstrProfValueData* VData,
                  uint32_t N,
                  llvm::InstrProfSymtab* SymTab)

Description

Add ValueData for ValueKind at value Site.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:781

Parameters

uint32_t ValueKind
uint32_t Site
InstrProfValueData* VData
uint32_t N
llvm::InstrProfSymtab* SymTab

void clearValueData()

Description

Clear value data entries

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:808

inline uint32_t getNumValueData(
    uint32_t ValueKind) const

Description

Return the total number of ValueData for ValueKind.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:757

Parameters

uint32_t ValueKind

inline uint32_t getNumValueDataForSite(
    uint32_t ValueKind,
    uint32_t Site) const

Description

Return the number of value data collected for ValueKind at profiling site: Site.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:761

Parameters

uint32_t ValueKind
uint32_t Site

inline uint32_t getNumValueKinds() const

Description

Return the number of value profile kinds with non-zero number of profile sites.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:752

inline uint32_t getNumValueSites(
    uint32_t ValueKind) const

Description

Return the number of instrumented sites for ValueKind.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:754

Parameters

uint32_t ValueKind

std::vector<InstrProfValueSiteRecord>&
getOrCreateValueSitesForKind(uint32_t ValueKind)

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:854

Parameters

uint32_t ValueKind

inline std::unique_ptr<InstrProfValueData[]>
getValueForSite(uint32_t ValueKind,
                uint32_t Site,
                uint64_t* TotalC = nullptr) const

Description

Return the array of profiled values at \p Site. If \p TotalC is not null, the total count of all target values at this site will be stored in \c *TotalC.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:768

Parameters

uint32_t ValueKind
uint32_t Site
uint64_t* TotalC = nullptr

inline uint64_t getValueForSite(
    InstrProfValueData* Dest,
    uint32_t ValueKind,
    uint32_t Site) const

Description

Get the target value/counts of kind \p ValueKind collected at site\p Site and store the result in array \p Dest. Return the total counts of all target values at this site.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:774

Parameters

InstrProfValueData* Dest
uint32_t ValueKind
uint32_t Site

ArrayRef<llvm::InstrProfValueSiteRecord>
getValueSitesForKind(uint32_t ValueKind) const

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:840

Parameters

uint32_t ValueKind

MutableArrayRef<llvm::InstrProfValueSiteRecord>
getValueSitesForKind(uint32_t ValueKind)

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:830

Parameters

uint32_t ValueKind

void merge(
    llvm::InstrProfRecord& Other,
    uint64_t Weight,
    function_ref<void(llvm::instrprof_error)>
        Warn)

Description

Merge the counts in \p Other into this one. Optionally scale merged counts by \p Weight.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:787

Parameters

llvm::InstrProfRecord& Other
uint64_t Weight
function_ref<void(llvm::instrprof_error)> Warn

void mergeValueProfData(
    uint32_t ValkeKind,
    llvm::InstrProfRecord& Src,
    uint64_t Weight,
    function_ref<void(llvm::instrprof_error)>
        Warn)

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:873

Parameters

uint32_t ValkeKind
llvm::InstrProfRecord& Src
uint64_t Weight
function_ref<void(llvm::instrprof_error)> Warn

void overlap(llvm::InstrProfRecord& Other,
             llvm::OverlapStats& Overlap,
             llvm::OverlapStats& FuncLevelOverlap,
             uint64_t ValueCutoff)

Description

Compute the overlap b/w this IntrprofRecord and Other.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:814

Parameters

llvm::InstrProfRecord& Other
llvm::OverlapStats& Overlap
llvm::OverlapStats& FuncLevelOverlap
uint64_t ValueCutoff

void overlapValueProfData(
    uint32_t ValueKind,
    llvm::InstrProfRecord& Src,
    llvm::OverlapStats& Overlap,
    llvm::OverlapStats& FuncLevelOverlap)

Description

Compute the overlap of value profile counts.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:818

Parameters

uint32_t ValueKind
llvm::InstrProfRecord& Src
llvm::OverlapStats& Overlap
llvm::OverlapStats& FuncLevelOverlap

uint64_t remapValue(uint64_t Value,
                    uint32_t ValueKind,
                    llvm::InstrProfSymtab* SymTab)

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:868

Parameters

uint64_t Value
uint32_t ValueKind
llvm::InstrProfSymtab* SymTab

inline void reserveSites(uint32_t ValueKind,
                         uint32_t NumValueSites)

Description

Reserve space for NumValueSites sites.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:778

Parameters

uint32_t ValueKind
uint32_t NumValueSites

void scale(
    uint64_t N,
    uint64_t D,
    function_ref<void(llvm::instrprof_error)>
        Warn)

Description

Scale up profile counts (including value profile data) by a factor of (N / D).

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:792

Parameters

uint64_t N
uint64_t D
function_ref<void(llvm::instrprof_error)> Warn

void scaleValueProfData(
    uint32_t ValueKind,
    uint64_t N,
    uint64_t D,
    function_ref<void(llvm::instrprof_error)>
        Warn)

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:878

Parameters

uint32_t ValueKind
uint64_t N
uint64_t D
function_ref<void(llvm::instrprof_error)> Warn

void sortValueData()

Description

Sort value profile data (per site) by count.

Declared at: llvm/include/llvm/ProfileData/InstrProf.h:795