llvm::LoopUnrollOptions

Parameters controlling transforms performed by the LoopUnroll pass.

Synopsis

Declared in <llvm/Transforms/Scalar/LoopUnrollPass.h>

struct LoopUnrollOptions;

Description

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.

Member Functions

NameDescription
LoopUnrollOptions [constructor]Construct LoopUnroll options with the given defaults.
setFullUnrollMaxCount Sets the maximum full-unroll count.
setOptLevel Sets the optimization level used to tune loop unrolling.
setPartial Enables or disables partial unrolling. When disabled only full unrolling is allowed.
setPeeling Enables or disables loop peeling.
setPrepareForLTO Sets whether to prepare for LTO by deferring unroll of inline candidates.
setProfileBasedPeeling Enables or disables loop peeling based on profile information.
setRuntime Enables or disables unrolling of loops with runtime trip count.
setUpperBound Enables or disables the use of trip count upper bound in loop unrolling.

Data Members

NameDescription
AllowPartial Whether to allow partial unrolling; None uses the global default.
AllowPeeling Whether to allow loop peeling; None uses the global default.
AllowProfileBasedPeeling Whether to allow profile-based loop peeling; None uses the global default.
AllowRuntime Whether to allow unrolling of loops with a runtime trip count; None uses the global default.
AllowUpperBound Whether to use a trip-count upper bound when unrolling; None uses the global default.
ForgetSCEV Whether to forget all loops in SCEV when unrolling.
FullUnrollMaxCount Maximum full-unroll count; None uses the global default.
OnlyWhenForced Whether to unroll only loops that request it via metadata.
OptLevel Optimization level used to tune loop unrolling decisions.
PrepareForLTO If true, consider calls as inline candidates and defer unrolling so that LTO post-link inlining can consider them first.