Displaying 1 result from an estimated 1 matches for "comparefreq".
2011 Jun 04
3
[LLVMdev] [llvm-commits] Branch Probability
...unity();
friend bool operator<(); // and friends
friend ScaledFreq operator+();
ScaledFreq scaled(unsigned num, unsigned denom) const;
};
A high-level API for comparing frequencies may look something like this:
// return true if the probability of B1 relative to B2 is at least Prob.
// e.g. compareFreq(B1, B2, Likely) is true if B1 is likely executed
// relative to B2.
bool compareFreq(B1, B2, Prob) {
return (uint64_t(B1) * (Prob.denom - Prob.numer))
> (uint64_t(B2) * Prob.numerator)
}