ΒΆOptional<unsigned int> getLoopEstimatedTripCount(
    llvm::Loop* L,
    unsigned int* EstimatedLoopInvocationWeight =
        nullptr)

Description

Returns a loop's estimated trip count based on branch weight metadata. In addition if \p EstimatedLoopInvocationWeight is not null it is initialized with weight of loop's latch leading to the exit. Returns 0 when the count is estimated to be 0, or None when a meaningful estimate can not be made.

Declared at: llvm/include/llvm/Transforms/Utils/LoopUtils.h:315

Parameters

llvm::Loop* L
unsigned int* EstimatedLoopInvocationWeight = nullptr