LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::LoopUnrollOptions Struct Reference

A set of parameters used to control various transforms performed by the LoopUnroll pass. More...

#include "llvm/Transforms/Scalar/LoopUnrollPass.h"

Public Member Functions

 LoopUnrollOptions (int OptLevel=2, bool OnlyWhenForced=false, bool ForgetSCEV=false)
 
LoopUnrollOptionssetPartial (bool Partial)
 Enables or disables partial unrolling.
 
LoopUnrollOptionssetRuntime (bool Runtime)
 Enables or disables unrolling of loops with runtime trip count.
 
LoopUnrollOptionssetPeeling (bool Peeling)
 Enables or disables loop peeling.
 
LoopUnrollOptionssetUpperBound (bool UpperBound)
 Enables or disables the use of trip count upper bound in loop unrolling.
 
LoopUnrollOptionssetOptLevel (int O)
 
LoopUnrollOptionssetProfileBasedPeeling (int O)
 
LoopUnrollOptionssetFullUnrollMaxCount (unsigned O)
 

Public Attributes

std::optional< boolAllowPartial
 
std::optional< boolAllowPeeling
 
std::optional< boolAllowRuntime
 
std::optional< boolAllowUpperBound
 
std::optional< boolAllowProfileBasedPeeling
 
std::optional< unsignedFullUnrollMaxCount
 
int OptLevel
 
bool OnlyWhenForced
 If false, use a cost model to determine whether unrolling of a loop is profitable.
 
const bool ForgetSCEV
 If true, forget all loops when unrolling.
 

Detailed Description

A set of parameters used to control various transforms performed by the LoopUnroll pass.

Each of the boolean parameters can be set to: true - enabling the transformation. false - disabling the transformation. None - relying on a global default.

There is also OptLevel parameter, which is used for additional loop unroll tuning.

Intended use is to create a default object, modify parameters with additional setters and then pass it to LoopUnrollPass.

Definition at line 61 of file LoopUnrollPass.h.

Constructor & Destructor Documentation

◆ LoopUnrollOptions()

llvm::LoopUnrollOptions::LoopUnrollOptions ( int  OptLevel = 2,
bool  OnlyWhenForced = false,
bool  ForgetSCEV = false 
)
inline

Definition at line 80 of file LoopUnrollPass.h.

Member Function Documentation

◆ setFullUnrollMaxCount()

LoopUnrollOptions & llvm::LoopUnrollOptions::setFullUnrollMaxCount ( unsigned  O)
inline

Definition at line 124 of file LoopUnrollPass.h.

References FullUnrollMaxCount.

◆ setOptLevel()

LoopUnrollOptions & llvm::LoopUnrollOptions::setOptLevel ( int  O)
inline

Definition at line 112 of file LoopUnrollPass.h.

References OptLevel.

◆ setPartial()

LoopUnrollOptions & llvm::LoopUnrollOptions::setPartial ( bool  Partial)
inline

Enables or disables partial unrolling.

When disabled only full unrolling is allowed.

Definition at line 87 of file LoopUnrollPass.h.

References AllowPartial.

◆ setPeeling()

LoopUnrollOptions & llvm::LoopUnrollOptions::setPeeling ( bool  Peeling)
inline

Enables or disables loop peeling.

Definition at line 99 of file LoopUnrollPass.h.

References AllowPeeling.

◆ setProfileBasedPeeling()

LoopUnrollOptions & llvm::LoopUnrollOptions::setProfileBasedPeeling ( int  O)
inline

Definition at line 118 of file LoopUnrollPass.h.

References AllowProfileBasedPeeling.

◆ setRuntime()

LoopUnrollOptions & llvm::LoopUnrollOptions::setRuntime ( bool  Runtime)
inline

Enables or disables unrolling of loops with runtime trip count.

Definition at line 93 of file LoopUnrollPass.h.

References AllowRuntime, and llvm::Runtime.

◆ setUpperBound()

LoopUnrollOptions & llvm::LoopUnrollOptions::setUpperBound ( bool  UpperBound)
inline

Enables or disables the use of trip count upper bound in loop unrolling.

Definition at line 106 of file LoopUnrollPass.h.

References AllowUpperBound.

Member Data Documentation

◆ AllowPartial

std::optional<bool> llvm::LoopUnrollOptions::AllowPartial

◆ AllowPeeling

std::optional<bool> llvm::LoopUnrollOptions::AllowPeeling

◆ AllowProfileBasedPeeling

std::optional<bool> llvm::LoopUnrollOptions::AllowProfileBasedPeeling

◆ AllowRuntime

std::optional<bool> llvm::LoopUnrollOptions::AllowRuntime

◆ AllowUpperBound

std::optional<bool> llvm::LoopUnrollOptions::AllowUpperBound

◆ ForgetSCEV

const bool llvm::LoopUnrollOptions::ForgetSCEV

If true, forget all loops when unrolling.

If false, forget top-most loop of the currently processed loops, which removes one entry at a time from the internal SCEV records. For large loops, the former is faster.

Definition at line 78 of file LoopUnrollPass.h.

Referenced by llvm::LoopUnrollPass::run().

◆ FullUnrollMaxCount

std::optional<unsigned> llvm::LoopUnrollOptions::FullUnrollMaxCount

◆ OnlyWhenForced

bool llvm::LoopUnrollOptions::OnlyWhenForced

If false, use a cost model to determine whether unrolling of a loop is profitable.

If true, only loops that explicitly request unrolling via metadata are considered. All other loops are skipped.

Definition at line 73 of file LoopUnrollPass.h.

Referenced by llvm::LoopUnrollPass::run().

◆ OptLevel

int llvm::LoopUnrollOptions::OptLevel

The documentation for this struct was generated from the following file: