Utility class for getting and setting loop vectorizer hints.

Synopsis

Declared in <llvm/Transforms/Vectorize/LoopVectorizationLegality.h>

class LoopVectorizeHints;

Description

Hints are stored as loop metadata. This class keeps a number of loop annotations locally (as member variables) and can, upon request, write them back as metadata on the loop. It will initially scan the loop for existing metadata, and will update the local values based on information in the loop. We cannot write all values to metadata, as the mere presence of some info, for example 'force', means a decision has been made. So, we need to be careful NOT to add them if the user hasn't specifically asked so.

Enums

Name

Description

ForceKind

Whether vectorization is forced on or off.

ScalableForceKind

Preference between scalable and fixed‐width vectorization.

Member Functions

Name

Description

LoopVectorizeHints [constructor]

Construct hints for loop L from its metadata and target info.

allowReordering

Return true if enabling hints allow reordering of scalar‐loop operations.

allowVectorization

Return true if vectorization of L is allowed given these hints.

emitRemarkWithHints

Dumps all the hint information.

getForce

Return whether vectorization is forced enabled or disabled.

getInterleave

Return the requested interleave count, or a default when unset.

getIsVectorized

Return the already‐vectorized hint value.

getPredicate

Return the predicate/force hint for masked vectorization.

getWidth

Return the requested vectorization width.

isPotentiallyUnsafe

Return true if the loop may contain unsafe floating‐point math.

isScalableVectorizationAlwaysPreferred

Return true if scalable vectors are always preferred when feasible.

isScalableVectorizationDisabled

Return true if scalable vectorization has been explicitly disabled.

setAlreadyVectorized

Mark the loop L as already vectorized by setting the width to 1.

setPotentiallyUnsafe

Mark the loop as containing potentially unsafe floating‐point math.

Created with MrDocs