summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-04-29 16:12:16 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-04-29 16:12:16 +0000
commit9c770981251c6795e7361857b3706c889a9b6276 (patch)
tree30e762fd15ba2c623c3ff7e646dfe514007a04f5 /include/llvm
parent4afab2afa876e804de71a8178fa61746a5ca96b3 (diff)
downloadllvm-9c770981251c6795e7361857b3706c889a9b6276.tar.gz
llvm-9c770981251c6795e7361857b3706c889a9b6276.tar.bz2
llvm-9c770981251c6795e7361857b3706c889a9b6276.tar.xz
Support: Simplify BranchProbability operators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Support/BranchProbability.h12
1 files changed, 3 insertions, 9 deletions
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);