From 9c770981251c6795e7361857b3706c889a9b6276 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 29 Apr 2014 16:12:16 +0000 Subject: Support: Simplify BranchProbability operators git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207541 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/BranchProbability.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'include/llvm') diff --git a/include/llvm/Support/BranchProbability.h b/include/llvm/Support/BranchProbability.h index eedf69247e..bf6b01defa 100644 --- a/include/llvm/Support/BranchProbability.h +++ b/include/llvm/Support/BranchProbability.h @@ -59,15 +59,9 @@ public: bool operator<(BranchProbability RHS) const { return (uint64_t)N * RHS.D < (uint64_t)D * RHS.N; } - bool operator>(BranchProbability RHS) const { - return RHS < *this; - } - bool operator<=(BranchProbability RHS) const { - return (uint64_t)N * RHS.D <= (uint64_t)D * RHS.N; - } - bool operator>=(BranchProbability RHS) const { - return RHS <= *this; - } + bool operator>(BranchProbability RHS) const { return RHS < *this; } + bool operator<=(BranchProbability RHS) const { return !(RHS < *this); } + bool operator>=(BranchProbability RHS) const { return !(*this < RHS); } }; raw_ostream &operator<<(raw_ostream &OS, const BranchProbability &Prob); -- cgit v1.2.3