Support: Simplify BranchProbability operators

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207541 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2014-04-29 16:12:16 +00:00
parent 4afab2afa8
commit 9c77098125

View File

@ -59,15 +59,9 @@ public:
bool operator<(BranchProbability RHS) const { bool operator<(BranchProbability RHS) const {
return (uint64_t)N * RHS.D < (uint64_t)D * RHS.N; return (uint64_t)N * RHS.D < (uint64_t)D * RHS.N;
} }
bool operator>(BranchProbability RHS) const { bool operator>(BranchProbability RHS) const { return RHS < *this; }
return RHS < *this; bool operator<=(BranchProbability RHS) const { return !(RHS < *this); }
} bool operator>=(BranchProbability RHS) const { return !(*this < RHS); }
bool operator<=(BranchProbability RHS) const {
return (uint64_t)N * RHS.D <= (uint64_t)D * RHS.N;
}
bool operator>=(BranchProbability RHS) const {
return RHS <= *this;
}
}; };
raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob); raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob);