mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-17 06:33:21 +00:00
- Make BranchProbability constructor public.
- Add getCompl() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134857 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2b33f4cbad
commit
687dc24e1d
@ -22,6 +22,7 @@
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
class raw_ostream;
|
class raw_ostream;
|
||||||
|
class MachineBasicBlock;
|
||||||
|
|
||||||
class MachineBranchProbabilityInfo : public ImmutablePass {
|
class MachineBranchProbabilityInfo : public ImmutablePass {
|
||||||
|
|
||||||
|
@ -18,20 +18,10 @@
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
template<class BlockT, class FunctionT, class BranchProbInfoT>
|
|
||||||
class BlockFrequencyImpl;
|
|
||||||
class BranchProbabilityInfo;
|
|
||||||
class MachineBranchProbabilityInfo;
|
|
||||||
class MachineBasicBlock;
|
|
||||||
class raw_ostream;
|
class raw_ostream;
|
||||||
|
|
||||||
// This class represents Branch Probability as a non-negative fraction.
|
// This class represents Branch Probability as a non-negative fraction.
|
||||||
class BranchProbability {
|
class BranchProbability {
|
||||||
template<class BlockT, class FunctionT, class BranchProbInfoT>
|
|
||||||
friend class BlockFrequencyImpl;
|
|
||||||
friend class BranchProbabilityInfo;
|
|
||||||
friend class MachineBranchProbabilityInfo;
|
|
||||||
friend class MachineBasicBlock;
|
|
||||||
|
|
||||||
// Numerator
|
// Numerator
|
||||||
uint32_t N;
|
uint32_t N;
|
||||||
@ -39,13 +29,17 @@ class BranchProbability {
|
|||||||
// Denominator
|
// Denominator
|
||||||
uint32_t D;
|
uint32_t D;
|
||||||
|
|
||||||
BranchProbability(uint32_t n, uint32_t d);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
BranchProbability(uint32_t n, uint32_t d);
|
||||||
|
|
||||||
uint32_t getNumerator() const { return N; }
|
uint32_t getNumerator() const { return N; }
|
||||||
uint32_t getDenominator() const { return D; }
|
uint32_t getDenominator() const { return D; }
|
||||||
|
|
||||||
|
// Return (1 - Probability).
|
||||||
|
BranchProbability getCompl() {
|
||||||
|
return BranchProbability(D - N, D);
|
||||||
|
}
|
||||||
|
|
||||||
raw_ostream &print(raw_ostream &OS) const;
|
raw_ostream &print(raw_ostream &OS) const;
|
||||||
|
|
||||||
void dump() const;
|
void dump() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user