llvm::BasicTTIImplBase::getEstimatedNumberOfCaseClusters

Estimate how many case clusters SI would lower into.

Synopsis

Declared in <llvm/CodeGen/BasicTTIImpl.h>

unsigned int
getEstimatedNumberOfCaseClusters(
    SwitchInst const& SI,
    unsigned int& JumpTableSize,
    ProfileSummaryInfo* PSI,
    BlockFrequencyInfo* BFI) const override;

Description

The number of clusters identified here can differ from lowering. Switches lowered with a mix of jump table / bit test / BTree are ignored. Useful for inline cost and other heuristics such as loop unrolling.

Return Value

The estimated number of case clusters SI would lower into.

Parameters

NameDescription
SISwitch instruction being analyzed.
JumpTableSizeSet to the jump-table size when a table is suitable.
PSIOptional profile summary info.
BFIOptional block frequency info.