search for: scaledfreq

Displaying 1 result from an estimated 1 matches for "scaledfreq".

2011 Jun 04
3
[LLVMdev] [llvm-commits] Branch Probability
...as meaningful values. Typically, a pass will be comparing the frequency of two blocks to determine the relative hotness. Scaled frequencies can be wrapped in a simple class that supports only comparison and addition to ensure that clients don't misuse them. Subtraction is not supported. class ScaledFreq { static ScaledFreq 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 a...