LLVM  11.0.0git
Classes | Public Types | Public Member Functions | List of all members
llvm::LoopVectorizeHints Class Reference

Utility class for getting and setting loop vectorizer hints in the form of loop metadata. More...

#include "llvm/Transforms/Vectorize/LoopVectorizationLegality.h"

Public Types

enum  ForceKind { FK_Undefined = -1, FK_Disabled = 0, FK_Enabled = 1 }

Public Member Functions

 LoopVectorizeHints (const Loop *L, bool InterleaveOnlyWhenForced, OptimizationRemarkEmitter &ORE)
void setAlreadyVectorized ()
 Mark the loop L as already vectorized by setting the width to 1. More...
bool allowVectorization (Function *F, Loop *L, bool VectorizeOnlyWhenForced) const
void emitRemarkWithHints () const
 Dumps all the hint information. More...
unsigned getWidth () const
unsigned getInterleave () const
unsigned getIsVectorized () const
unsigned getPredicate () const
enum ForceKind getForce () const
const charvectorizeAnalysisPassName () const
 If hints are provided that force vectorization, use the AlwaysPrint pass name to force the frontend to print the diagnostic. More...
bool allowReordering () const
bool isPotentiallyUnsafe () const
void setPotentiallyUnsafe ()

Detailed Description

Utility class for getting and setting loop vectorizer hints in the form of 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.

Definition at line 45 of file LoopVectorizationLegality.h.

Member Enumeration Documentation

◆ ForceKind


Not selected.


Forcing disabled.


Forcing enabled.

Definition at line 83 of file LoopVectorizationLegality.h.

Constructor & Destructor Documentation

◆ LoopVectorizeHints()

llvm::LoopVectorizeHints::LoopVectorizeHints ( const Loop L,
bool  InterleaveOnlyWhenForced,
OptimizationRemarkEmitter ORE 

Member Function Documentation

◆ allowReordering()

bool llvm::LoopVectorizeHints::allowReordering ( ) const

◆ allowVectorization()

bool llvm::LoopVectorizeHints::allowVectorization ( Function F,
Loop L,
bool  VectorizeOnlyWhenForced 
) const

◆ emitRemarkWithHints()

void llvm::LoopVectorizeHints::emitRemarkWithHints ( ) const

Dumps all the hint information.

Definition at line 148 of file LoopVectorizationLegality.cpp.

References FK_Disabled, FK_Enabled, and LV_NAME.

Referenced by allowVectorization().

◆ getForce()

enum ForceKind llvm::LoopVectorizeHints::getForce ( ) const

◆ getInterleave()

unsigned llvm::LoopVectorizeHints::getInterleave ( ) const

Definition at line 102 of file LoopVectorizationLegality.h.

◆ getIsVectorized()

unsigned llvm::LoopVectorizeHints::getIsVectorized ( ) const

Definition at line 103 of file LoopVectorizationLegality.h.

Referenced by allowVectorization().

◆ getPredicate()

unsigned llvm::LoopVectorizeHints::getPredicate ( ) const

Definition at line 104 of file LoopVectorizationLegality.h.

Referenced by getScalarEpilogueLowering().

◆ getWidth()

unsigned llvm::LoopVectorizeHints::getWidth ( ) const

◆ isPotentiallyUnsafe()

bool llvm::LoopVectorizeHints::isPotentiallyUnsafe ( ) const

Definition at line 125 of file LoopVectorizationLegality.h.

References FK_Enabled, and getForce().

◆ setAlreadyVectorized()

void llvm::LoopVectorizeHints::setAlreadyVectorized ( )

◆ setPotentiallyUnsafe()

void llvm::LoopVectorizeHints::setPotentiallyUnsafe ( )

Definition at line 134 of file LoopVectorizationLegality.h.

References Arg, and Name.

◆ vectorizeAnalysisPassName()

const char * llvm::LoopVectorizeHints::vectorizeAnalysisPassName ( ) const

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