class BlockMass

Declaration

class BlockMass { /* full declaration omitted */ };

Description

Mass of a block. This class implements a sort of fixed-point fraction always between 0.0 and 1.0. getMass() == std::numeric_limits <uint64 _t>::max() indicates a value of 1.0. Masses can be added and subtracted. Simple saturation arithmetic is used, so arithmetic operations never overflow or underflow. Masses can be multiplied. Multiplication treats full mass as 1.0 and uses an inexpensive floating-point algorithm that's off-by-one (almost, but not quite, maximum precision). Masses can be scaled by \a BranchProbability at maximum precision.

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:82

Method Overview

  • public BlockMass()
  • public BlockMass(uint64_t Mass)
  • public void dump() const
  • public static llvm::bfi_detail::BlockMass getEmpty()
  • public static llvm::bfi_detail::BlockMass getFull()
  • public uint64_t getMass() const
  • public bool isEmpty() const
  • public bool isFull() const
  • public llvm::raw_ostream & print(llvm::raw_ostream & OS) const
  • public ScaledNumber<uint64_t> toScaled() const

Methods

BlockMass()

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:86

BlockMass(uint64_t Mass)

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:87

Parameters

uint64_t Mass

void dump() const

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:139

static llvm::bfi_detail::BlockMass getEmpty()

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:89

static llvm::bfi_detail::BlockMass getFull()

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:91

uint64_t getMass() const

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:95

bool isEmpty() const

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:98

bool isFull() const

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:97

llvm::raw_ostream& print(
    llvm::raw_ostream& OS) const

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:140

Parameters

llvm::raw_ostream& OS

ScaledNumber<uint64_t> toScaled() const

Description

Convert to scaled number. Convert to \a ScaledNumber. \a isFull() gives 1.0, while \a isEmpty() gives slightly above 0.0.

Declared at: llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:137