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:53
Method Overview
- public ValueProfileCollector(llvm::Function & Fn)
- public ValueProfileCollector(llvm::ValueProfileCollector &&)
- public ValueProfileCollector(const llvm::ValueProfileCollector &)
- public std::vector<CandidateInfo> get(llvm::InstrProfValueKind Kind) const
- public ~ValueProfileCollector()
Methods
¶ValueProfileCollector(llvm::Function& Fn)
ValueProfileCollector(llvm::Function& Fn)
Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:61
Parameters
- llvm::Function& Fn
¶ValueProfileCollector(
llvm::ValueProfileCollector&&)
ValueProfileCollector(
llvm::ValueProfileCollector&&)
Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:62
Parameters
¶ValueProfileCollector(
const llvm::ValueProfileCollector&)
ValueProfileCollector(
const llvm::ValueProfileCollector&)
Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:65
Parameters
- const llvm::ValueProfileCollector&
¶std::vector<CandidateInfo> get(
llvm::InstrProfValueKind Kind) const
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:70
Parameters
- llvm::InstrProfValueKind Kind
¶~ValueProfileCollector()
~ValueProfileCollector()
Declared at: llvm/lib/Transforms/Instrumentation/ValueProfileCollector.h:67