diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-10-23 20:10:34 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-10-23 20:10:34 +0000 |
commit | 66d847c8ffff5199248fccc10cb27f80c5cf9ebe (patch) | |
tree | c85984aecdf46a13c7e758c9fd0978dac1ebc7f7 /include/llvm/Support | |
parent | 4f780536953cdd3d92c21111301763ddd57ab720 (diff) | |
download | external_llvm-66d847c8ffff5199248fccc10cb27f80c5cf9ebe.zip external_llvm-66d847c8ffff5199248fccc10cb27f80c5cf9ebe.tar.gz external_llvm-66d847c8ffff5199248fccc10cb27f80c5cf9ebe.tar.bz2 |
Now that we have comparison on probabilities, add some static functions
to get important constant branch probabilities and use them for finding
the best branch out of a set of possibilities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/BranchProbability.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Support/BranchProbability.h b/include/llvm/Support/BranchProbability.h index a1e5ceb..6b83159 100644 --- a/include/llvm/Support/BranchProbability.h +++ b/include/llvm/Support/BranchProbability.h @@ -39,6 +39,9 @@ public: assert(n <= d && "Probability cannot be bigger than 1!"); } + static BranchProbability getZero() { return BranchProbability(0, 1); } + static BranchProbability getOne() { return BranchProbability(1, 1); } + uint32_t getNumerator() const { return N; } uint32_t getDenominator() const { return D; } |