llvm::calculateCountScale

Calculate what to divide by to scale counts.

Synopsis

Declared in <llvm/IR/ProfDataUtils.h>

uint64_t
calculateCountScale(uint64_t MaxCount);

Description

Given the maximum count, calculate a divisor that will scale all the weights to strictly less than std::numeric_limits<uint32_t>::max().

Return Value

The divisor to use when scaling counts down to 32 bits.

Parameters

NameDescription
MaxCountThe largest count that will be scaled.