summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-06-21 23:45:18 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-06-21 23:45:18 +0000
commit2ea475cddf42ce3421f0463be670c77c93329b2c (patch)
tree381e30c5e2ba0db138f4dd70763ac85e3ebb0a77
parent6f0ca0c59048b661bbf492429ff42ce137108626 (diff)
downloadllvm-2ea475cddf42ce3421f0463be670c77c93329b2c.tar.gz
llvm-2ea475cddf42ce3421f0463be670c77c93329b2c.tar.bz2
llvm-2ea475cddf42ce3421f0463be670c77c93329b2c.tar.xz
Reapply documentation changes from r184584.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184609 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/BlockFrequency.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/Support/BlockFrequency.h b/include/llvm/Support/BlockFrequency.h
index 839cf93712..77b1bf4413 100644
--- a/include/llvm/Support/BlockFrequency.h
+++ b/include/llvm/Support/BlockFrequency.h
@@ -30,12 +30,19 @@ class BlockFrequency {
public:
BlockFrequency(uint64_t Freq = 0) : Frequency(Freq) { }
+ /// \brief Returns the frequency of the entry block of the function.
static uint64_t getEntryFrequency() { return ENTRY_FREQ; }
+
+ /// \brief Returns the frequency as a fixpoint number scaled by the entry
+ /// frequency.
uint64_t getFrequency() const { return Frequency; }
+ /// \brief Multiplies with a branch probability. The computation will never
+ /// overflow.
BlockFrequency &operator*=(const BranchProbability &Prob);
const BlockFrequency operator*(const BranchProbability &Prob) const;
+ /// \brief Adds another block frequency using saturating arithmetic.
BlockFrequency &operator+=(const BlockFrequency &Freq);
const BlockFrequency operator+(const BlockFrequency &Freq) const;