LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::UnrollCostEstimator Class Reference

Produce an estimate of the unrolled cost of the specified loop. More...

#include "llvm/Transforms/Utils/UnrollLoop.h"

Public Member Functions

 UnrollCostEstimator (const Loop *L, const TargetTransformInfo &TTI, const SmallPtrSetImpl< const Value * > &EphValues, unsigned BEInsns)
 
bool canUnroll () const
 Whether it is legal to unroll this loop.
 
uint64_t getRolledLoopSize () const
 
uint64_t getUnrolledLoopSize (const TargetTransformInfo::UnrollingPreferences &UP, unsigned CountOverwrite=0) const
 Returns loop size estimation for unrolled loop, given the unrolling configuration specified by UP.
 

Public Attributes

unsigned NumInlineCandidates
 
ConvergenceKind Convergence
 
bool ConvergenceAllowsRuntime
 

Detailed Description

Produce an estimate of the unrolled cost of the specified loop.

This is used to a) produce a cost estimate for partial unrolling and b) to cheaply estimate cost for full unrolling when we don't want to symbolically evaluate all iterations.

Definition at line 127 of file UnrollLoop.h.

Constructor & Destructor Documentation

◆ UnrollCostEstimator()

UnrollCostEstimator::UnrollCostEstimator ( const Loop L,
const TargetTransformInfo TTI,
const SmallPtrSetImpl< const Value * > &  EphValues,
unsigned  BEInsns 
)

Member Function Documentation

◆ canUnroll()

bool UnrollCostEstimator::canUnroll ( ) const

Whether it is legal to unroll this loop.

Definition at line 708 of file LoopUnrollPass.cpp.

References Convergence, llvm::dbgs(), llvm::ExtendedLoop, llvm::InstructionCost::isValid(), and LLVM_DEBUG.

Referenced by computeHeuristicUnrollFactor(), tryToUnrollAndJamLoop(), and tryToUnrollLoop().

◆ getRolledLoopSize()

uint64_t llvm::UnrollCostEstimator::getRolledLoopSize ( ) const
inline

◆ getUnrolledLoopSize()

uint64_t UnrollCostEstimator::getUnrolledLoopSize ( const TargetTransformInfo::UnrollingPreferences UP,
unsigned  CountOverwrite = 0 
) const

Returns loop size estimation for unrolled loop, given the unrolling configuration specified by UP.

Definition at line 727 of file LoopUnrollPass.cpp.

References assert(), llvm::TargetTransformInfo::UnrollingPreferences::BEInsns, llvm::TargetTransformInfo::UnrollingPreferences::Count, and llvm::InstructionCost::getValue().

Referenced by llvm::computeUnrollCount(), shouldFullUnroll(), shouldPartialUnroll(), and shouldPragmaUnroll().

Member Data Documentation

◆ Convergence

ConvergenceKind llvm::UnrollCostEstimator::Convergence

Definition at line 133 of file UnrollLoop.h.

Referenced by canUnroll(), tryToUnrollAndJamLoop(), and UnrollCostEstimator().

◆ ConvergenceAllowsRuntime

bool llvm::UnrollCostEstimator::ConvergenceAllowsRuntime

Definition at line 134 of file UnrollLoop.h.

Referenced by tryToUnrollLoop(), and UnrollCostEstimator().

◆ NumInlineCandidates

unsigned llvm::UnrollCostEstimator::NumInlineCandidates

Definition at line 132 of file UnrollLoop.h.

Referenced by tryToUnrollAndJamLoop(), tryToUnrollLoop(), and UnrollCostEstimator().


The documentation for this class was generated from the following files: