13#ifndef LLVM_SUPPORT_BLOCKFREQUENCY_H
14#define LLVM_SUPPORT_BLOCKFREQUENCY_H
23class BranchProbability;
53 Frequency += Freq.Frequency;
70 if (Frequency <= Freq.Frequency)
73 Frequency -= Freq.Frequency;
83 std::optional<BlockFrequency>
mul(
uint64_t Factor)
const;
94 Frequency |= Frequency == 0;
99 return Frequency <
RHS.Frequency;
103 return Frequency <=
RHS.Frequency;
107 return Frequency >
RHS.Frequency;
111 return Frequency >=
RHS.Frequency;
115 return Frequency ==
RHS.Frequency;
119 return Frequency !=
RHS.Frequency;
124 BlockFrequency Freq);
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool operator!=(BlockFrequency RHS) const
BlockFrequency operator+(BlockFrequency Freq) const
BlockFrequency operator/(BranchProbability Prob) const
bool operator>=(BlockFrequency RHS) const
BlockFrequency(uint64_t Freq)
static BlockFrequency max()
Returns the maximum possible frequency, the saturation value.
BlockFrequency & operator-=(BlockFrequency Freq)
Subtracts another block frequency using saturating arithmetic.
std::optional< BlockFrequency > mul(uint64_t Factor) const
Multiplies frequency with Factor. Returns nullopt in case of overflow.
uint64_t getFrequency() const
Returns the frequency as a fixpoint number scaled by the entry frequency.
bool operator<(BlockFrequency RHS) const
bool operator==(BlockFrequency RHS) const
BlockFrequency & operator+=(BlockFrequency Freq)
Adds another block frequency using saturating arithmetic.
BlockFrequency operator*(BranchProbability Prob) const
bool operator>(BlockFrequency RHS) const
bool operator<=(BlockFrequency RHS) const
BlockFrequency & operator>>=(const unsigned count)
Shift block frequency to the right by count digits saturating to 1.
BlockFrequency & operator*=(BranchProbability Prob)
Multiplies with a branch probability.
BlockFrequency operator-(BlockFrequency Freq) const
BlockFrequency & operator/=(BranchProbability Prob)
Divide by a non-zero branch probability using saturating arithmetic.
This is an optimization pass for GlobalISel generic memory operations.
auto count(R &&Range, const E &Element)
Wrapper function around std::count to count the number of times an element Element occurs in the give...
void printRelativeBlockFreq(raw_ostream &OS, BlockFrequency EntryFreq, BlockFrequency Freq)