diff options
| author | 2020-08-03 15:06:44 +0000 | |
|---|---|---|
| committer | 2020-08-03 15:06:44 +0000 | |
| commit | b64793999546ed8adebaeebd9d8345d18db8927d (patch) | |
| tree | 4357c27b561d73b0e089727c6ed659f2ceff5f47 /gnu/llvm/lib/Support/BlockFrequency.cpp | |
| parent | Add support for UTF-8 DISPLAY-HINTs with octet length. For now only (diff) | |
| download | wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.tar.xz wireguard-openbsd-b64793999546ed8adebaeebd9d8345d18db8927d.zip | |
Remove LLVM 8.0.1 files.
Diffstat (limited to 'gnu/llvm/lib/Support/BlockFrequency.cpp')
| -rw-r--r-- | gnu/llvm/lib/Support/BlockFrequency.cpp | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/gnu/llvm/lib/Support/BlockFrequency.cpp b/gnu/llvm/lib/Support/BlockFrequency.cpp deleted file mode 100644 index 34fcbde23a2..00000000000 --- a/gnu/llvm/lib/Support/BlockFrequency.cpp +++ /dev/null @@ -1,83 +0,0 @@ -//====--------------- lib/Support/BlockFrequency.cpp -----------*- C++ -*-====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements Block Frequency class. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Support/BlockFrequency.h" -#include <cassert> - -using namespace llvm; - -BlockFrequency &BlockFrequency::operator*=(BranchProbability Prob) { - Frequency = Prob.scale(Frequency); - return *this; -} - -BlockFrequency BlockFrequency::operator*(BranchProbability Prob) const { - BlockFrequency Freq(Frequency); - Freq *= Prob; - return Freq; -} - -BlockFrequency &BlockFrequency::operator/=(BranchProbability Prob) { - Frequency = Prob.scaleByInverse(Frequency); - return *this; -} - -BlockFrequency BlockFrequency::operator/(BranchProbability Prob) const { - BlockFrequency Freq(Frequency); - Freq /= Prob; - return Freq; -} - -BlockFrequency &BlockFrequency::operator+=(BlockFrequency Freq) { - uint64_t Before = Freq.Frequency; - Frequency += Freq.Frequency; - - // If overflow, set frequency to the maximum value. - if (Frequency < Before) - Frequency = UINT64_MAX; - - return *this; -} - -BlockFrequency BlockFrequency::operator+(BlockFrequency Freq) const { - BlockFrequency NewFreq(Frequency); - NewFreq += Freq; - return NewFreq; -} - -BlockFrequency &BlockFrequency::operator-=(BlockFrequency Freq) { - // If underflow, set frequency to 0. - if (Frequency <= Freq.Frequency) - Frequency = 0; - else - Frequency -= Freq.Frequency; - return *this; -} - -BlockFrequency BlockFrequency::operator-(BlockFrequency Freq) const { - BlockFrequency NewFreq(Frequency); - NewFreq -= Freq; - return NewFreq; -} - -BlockFrequency &BlockFrequency::operator>>=(const unsigned count) { - // Frequency can never be 0 by design. - assert(Frequency != 0); - - // Shift right by count. - Frequency >>= count; - - // Saturate to 1 if we are 0. - Frequency |= Frequency == 0; - return *this; -} |
