ΒΆllvm::LoopUnrollResult UnrollLoop(
    llvm::Loop* L,
    llvm::UnrollLoopOptions ULO,
    llvm::LoopInfo* LI,
    llvm::ScalarEvolution* SE,
    llvm::DominatorTree* DT,
    llvm::AssumptionCache* AC,
    const llvm::TargetTransformInfo* TTI,
    llvm::OptimizationRemarkEmitter* ORE,
    bool PreserveLCSSA,
    llvm::Loop** RemainderLoop = nullptr)

Description

Unroll the given loop by Count. The loop must be in LCSSA form. Unrolling can only fail when the loop's latch block is not terminated by a conditional branch instruction. However, if the trip count (and multiple) are not known, loop unrolling will mostly produce more code that is no faster. If Runtime is true then UnrollLoop will try to insert a prologue or epilogue that ensures the latch has a trip multiple of Count. UnrollLoop will not runtime-unroll the loop if computing the run-time trip count will be expensive and AllowExpensiveTripCount is false. The LoopInfo Analysis that is passed will be kept consistent. This utility preserves LoopInfo. It will also preserve ScalarEvolution and DominatorTree if they are non-null. If RemainderLoop is non-null, it will receive the remainder loop (if required and not fully unrolled).

Declared at: llvm/include/llvm/Transforms/Utils/UnrollLoop.h:77

Parameters

llvm::Loop* L
llvm::UnrollLoopOptions ULO
llvm::LoopInfo* LI
llvm::ScalarEvolution* SE
llvm::DominatorTree* DT
llvm::AssumptionCache* AC
const llvm::TargetTransformInfo* TTI
llvm::OptimizationRemarkEmitter* ORE
bool PreserveLCSSA
llvm::Loop** RemainderLoop = nullptr