llvm::computeUnrollCount

Compute the unroll count for L from analysis, pragmas, and preferences.

Synopsis

Declared in <llvm/Transforms/Utils/UnrollLoop.h>

unsigned int
computeUnrollCount(
    Loop* L,
    TargetTransformInfo const& TTI,
    DominatorTree& DT,
    LoopInfo* LI,
    AssumptionCache* AC,
    ScalarEvolution& SE,
    SmallPtrSetImpl<Value const*> const& EphValues,
    OptimizationRemarkEmitter* ORE,
    unsigned int TripCount,
    unsigned int MaxTripCount,
    bool MaxOrZero,
    unsigned int TripMultiple,
    UnrollCostEstimator const& UCE,
    TargetTransformInfo::UnrollingPreferences& UP,
    TargetTransformInfo::PeelingPreferences& PP);

Description

Uses metadata and command-line options that are specific to the LoopUnroll pass.

Return Value

Chosen unroll factor for L.

Parameters

NameDescription
LLoop whose unroll count is being decided.
TTITarget transform info used for cost modeling.
DTDominator tree used by peeling and unrolling heuristics.
LILoopInfo describing the loop nest.
ACAssumption cache used by cost analysis.
SEScalarEvolution providing trip-count information.
EphValuesEphemeral values excluded from size estimates.
ORERemark emitter for unrolling diagnostics.
TripCountExact trip count when known, otherwise 0.
MaxTripCountMaximum trip count when an exact count is unknown.
MaxOrZeroTrue when the trip count is either MaxTripCount or zero.
TripMultipleGreatest known multiple of the trip count.
UCEPrecomputed cost estimate for the rolled loop.
UPUnrolling preferences updated with the chosen policy.
PPPeeling preferences that may be adjusted alongside unrolling.