struct BlockFrequencyInfoImplBase::Distribution

Declaration

struct BlockFrequencyInfoImplBase::Distribution { /* full declaration omitted */ };

Description

Distribution of unscaled probability weight. Distribution of unscaled probability weight to a set of successors. This class collates the successor edge weights for later processing. \a DidOverflow indicates whether \a Total did overflow while adding to the distribution. It should never overflow twice.

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

Member Variables

public llvm::BlockFrequencyInfoImplBase::Distribution:: WeightList Weights
Individual successor weights.
public uint64_t Total = 0
Sum of all weights.
public bool DidOverflow = false
Whether \a Total did overflow.

Method Overview

  • public Distribution()
  • private void add(const llvm::BlockFrequencyInfoImplBase::BlockNode & Node, uint64_t Amount, Weight::DistType Type)
  • public void addBackedge(const llvm::BlockFrequencyInfoImplBase::BlockNode & Node, uint64_t Amount)
  • public void addExit(const llvm::BlockFrequencyInfoImplBase::BlockNode & Node, uint64_t Amount)
  • public void addLocal(const llvm::BlockFrequencyInfoImplBase::BlockNode & Node, uint64_t Amount)
  • public void normalize()

Methods

Distribution()

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

void add(const llvm::BlockFrequencyInfoImplBase::
             BlockNode& Node,
         uint64_t Amount,
         Weight::DistType Type)

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

Parameters

const llvm::BlockFrequencyInfoImplBase::BlockNode& Node
uint64_t Amount
Weight::DistType Type

void addBackedge(
    const llvm::BlockFrequencyInfoImplBase::
        BlockNode& Node,
    uint64_t Amount)

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

Parameters

const llvm::BlockFrequencyInfoImplBase::BlockNode& Node
uint64_t Amount

void addExit(
    const llvm::BlockFrequencyInfoImplBase::
        BlockNode& Node,
    uint64_t Amount)

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

Parameters

const llvm::BlockFrequencyInfoImplBase::BlockNode& Node
uint64_t Amount

void addLocal(
    const llvm::BlockFrequencyInfoImplBase::
        BlockNode& Node,
    uint64_t Amount)

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

Parameters

const llvm::BlockFrequencyInfoImplBase::BlockNode& Node
uint64_t Amount

void normalize()

Description

Normalize the distribution. Combines multiple edges to the same \a Weight::TargetNode and scales down so that \a Total fits into 32-bits. This is linear in the size of \a Weights. For the vast majority of cases, adjacent edge weights are combined by sorting WeightList and combining adjacent weights. However, for very large edge lists an auxiliary hash table is used.

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