class ValueProfileCollector

Declaration

class ValueProfileCollector { /* full declaration omitted */ };

Description

Utility analysis that determines what values are worth profiling. The actual logic is inside the ValueProfileCollectorImpl, whose job is to populate the Candidates vector. Value profiling an expression means to track the values that this expression takes at runtime and the frequency of each value. It is important to distinguish between two sets of value profiles for a particular expression: 1) The set of values at the point of evaluation. 2) The set of values at the point of use. In some cases, the two sets are identical, but it's not unusual for the two to differ. To elaborate more, consider this C code, and focus on the expression `nn`: void foo(int nn, bool b) { if (b) memcpy(x, y, nn); } The point of evaluation can be as early as the start of the function, and let's say the value profile for `nn` is: total=100; (value,freq) set = {(8,10), (32,50)} The point of use is right before we call memcpy, and since we execute the memcpy conditionally, the value profile of `nn` can be: total=15; (value,freq) set = {(8,10), (4,5)} For this reason, a plugin is responsible for computing the insertion point for each value to be profiled. The `CandidateInfo` structure encapsulates all the information needed for each value profile site.

Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:57

Member Variables

private std::unique_ptr<ValueProfileCollectorImpl> PImpl

Method Overview

Methods

ValueProfileCollector(
    llvm::Function& Fn,
    llvm::TargetLibraryInfo& TLI)

Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:65

Parameters

llvm::Function& Fn
llvm::TargetLibraryInfo& TLI

ValueProfileCollector(
    llvm::ValueProfileCollector&&)

Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:66

Parameters

llvm::ValueProfileCollector&&

ValueProfileCollector(
    const llvm::ValueProfileCollector&)

Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:69

Parameters

const llvm::ValueProfileCollector&

std::vector<CandidateInfo> get(
    llvm::InstrProfValueKind Kind) const

Description

returns a list of value profiling candidates of the given kind

Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:74

Parameters

llvm::InstrProfValueKind Kind

~ValueProfileCollector()

Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:71