aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/BranchProbability.h
diff options
context:
space:
mode:
authorJakub Staszak <jstaszak@apple.com>2011-06-23 21:45:20 +0000
committerJakub Staszak <jstaszak@apple.com>2011-06-23 21:45:20 +0000
commit44eb49c2a191108df801977c8e3dc03466c6c02a (patch)
treeb51888831a9e6a115cf5d8c57d5c4664669eb322 /include/llvm/Support/BranchProbability.h
parenta390a1aa48d8fa5085aa51b950f00d79dbb0c646 (diff)
downloadexternal_llvm-44eb49c2a191108df801977c8e3dc03466c6c02a.tar.gz
external_llvm-44eb49c2a191108df801977c8e3dc03466c6c02a.tar.bz2
external_llvm-44eb49c2a191108df801977c8e3dc03466c6c02a.zip
Introduce BlockFrequency analysis for BasicBlocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/BranchProbability.h')
-rw-r--r--include/llvm/Support/BranchProbability.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm/Support/BranchProbability.h b/include/llvm/Support/BranchProbability.h
index 7ba649133b..c66d224886 100644
--- a/include/llvm/Support/BranchProbability.h
+++ b/include/llvm/Support/BranchProbability.h
@@ -18,13 +18,17 @@
namespace llvm {
-class raw_ostream;
+template<class BlockT, class FunctionT, class BranchProbInfoT>
+class BlockFrequencyImpl;
class BranchProbabilityInfo;
class MachineBranchProbabilityInfo;
class MachineBasicBlock;
+class raw_ostream;
// This class represents Branch Probability as a non-negative fraction.
class BranchProbability {
+ template<class BlockT, class FunctionT, class BranchProbInfoT>
+ friend class BlockFrequencyImpl;
friend class BranchProbabilityInfo;
friend class MachineBranchProbabilityInfo;
friend class MachineBasicBlock;
@@ -38,6 +42,10 @@ class BranchProbability {
BranchProbability(uint32_t n, uint32_t d);
public:
+
+ uint32_t getNumerator() const { return N; }
+ uint32_t getDenominator() const { return D; }
+
raw_ostream &print(raw_ostream &OS) const;
void dump() const;