mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +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 {
|
||||
|
||||
class raw_ostream;
|
||||
class MachineBasicBlock;
|
||||
|
||||
class MachineBranchProbabilityInfo : public ImmutablePass {
|
||||
|
||||
|
@ -18,20 +18,10 @@
|
||||
|
||||
namespace llvm {
|
||||
|
||||
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;
|
||||
|
||||
// Numerator
|
||||
uint32_t N;
|
||||
@ -39,12 +29,16 @@ class BranchProbability {
|
||||
// Denominator
|
||||
uint32_t D;
|
||||
|
||||
BranchProbability(uint32_t n, uint32_t d);
|
||||
|
||||
public:
|
||||
BranchProbability(uint32_t n, uint32_t d);
|
||||
|
||||
uint32_t getNumerator() const { return N; }
|
||||
uint32_t getDenominator() const { return D; }
|
||||
|
||||
// Return (1 - Probability).
|
||||
BranchProbability getCompl() {
|
||||
return BranchProbability(D - N, D);
|
||||
}
|
||||
|
||||
raw_ostream &print(raw_ostream &OS) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user