diff options
author | Michael Gottesman <mgottesman@apple.com> | 2013-12-14 02:24:22 +0000 |
---|---|---|
committer | Michael Gottesman <mgottesman@apple.com> | 2013-12-14 02:24:22 +0000 |
commit | 1b98ef1c19082fb49bf6db7b008eec33361e1080 (patch) | |
tree | 2a14da4524f8fd0aa01a5405b03fe23a36dad9d5 /include | |
parent | 7cc5f793bc858e4be4fbf532942d14013f123e55 (diff) | |
download | llvm-1b98ef1c19082fb49bf6db7b008eec33361e1080.tar.gz llvm-1b98ef1c19082fb49bf6db7b008eec33361e1080.tar.bz2 llvm-1b98ef1c19082fb49bf6db7b008eec33361e1080.tar.xz |
[block-freq] Add a right shift to BlockFrequency that saturates at 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197302 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/BlockFrequency.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Support/BlockFrequency.h b/include/llvm/Support/BlockFrequency.h index 997d11e47a..dae520b54e 100644 --- a/include/llvm/Support/BlockFrequency.h +++ b/include/llvm/Support/BlockFrequency.h @@ -55,6 +55,9 @@ public: BlockFrequency &operator+=(const BlockFrequency &Freq); const BlockFrequency operator+(const BlockFrequency &Freq) const; + /// \brief Shift block frequency to the right by count digits saturating to 1. + BlockFrequency &operator>>=(const unsigned count); + /// \brief Scale the given BlockFrequency by N/D. Return the remainder from /// the division by D. Upon overflow, the routine will saturate. uint32_t scale(const BranchProbability &Prob); |