llvm.org GIT mirror llvm / 687dc24
- Make BranchProbability constructor public. - Add getCompl() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134857 91177308-0d34-0410-b5e6-96231b3b80d8 Jakub Staszak 9 years ago
2 changed file(s) with 7 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
2121 namespace llvm {
2222
2323 class raw_ostream;
24 class MachineBasicBlock;
2425
2526 class MachineBranchProbabilityInfo : public ImmutablePass {
2627
1717
1818 namespace llvm {
1919
20 template
21 class BlockFrequencyImpl;
22 class BranchProbabilityInfo;
23 class MachineBranchProbabilityInfo;
24 class MachineBasicBlock;
2520 class raw_ostream;
2621
2722 // This class represents Branch Probability as a non-negative fraction.
2823 class BranchProbability {
29 template
30 friend class BlockFrequencyImpl;
31 friend class BranchProbabilityInfo;
32 friend class MachineBranchProbabilityInfo;
33 friend class MachineBasicBlock;
3424
3525 // Numerator
3626 uint32_t N;
3828 // Denominator
3929 uint32_t D;
4030
31 public:
4132 BranchProbability(uint32_t n, uint32_t d);
42
43 public:
4433
4534 uint32_t getNumerator() const { return N; }
4635 uint32_t getDenominator() const { return D; }
36
37 // Return (1 - Probability).
38 BranchProbability getCompl() {
39 return BranchProbability(D - N, D);
40 }
4741
4842 raw_ostream &print(raw_ostream &OS) const;
4943