llvm.org GIT mirror llvm / 9c77098
Support: Simplify BranchProbability operators git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207541 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 6 years ago
1 changed file(s) with 3 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
5858 bool operator<(BranchProbability RHS) const {
5959 return (uint64_t)N * RHS.D < (uint64_t)D * RHS.N;
6060 }
61 bool operator>(BranchProbability RHS) const {
62 return RHS < *this;
63 }
64 bool operator<=(BranchProbability RHS) const {
65 return (uint64_t)N * RHS.D <= (uint64_t)D * RHS.N;
66 }
67 bool operator>=(BranchProbability RHS) const {
68 return RHS <= *this;
69 }
61 bool operator>(BranchProbability RHS) const { return RHS < *this; }
62 bool operator<=(BranchProbability RHS) const { return !(RHS < *this); }
63 bool operator>=(BranchProbability RHS) const { return !(*this < RHS); }
7064 };
7165
7266 raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob);