LLVM: llvm::LoopVectorizeHints Class Reference (original) (raw)
Utility class for getting and setting loop vectorizer hints in the form of loop metadata. More...
#include "[llvm/Transforms/Vectorize/LoopVectorizationLegality.h](LoopVectorizationLegality%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
LoopVectorizeHints (const Loop *L, bool InterleaveOnlyWhenForced, OptimizationRemarkEmitter &ORE, const TargetTransformInfo *TTI=nullptr) | |
void | setAlreadyVectorized () |
Mark the loop L as already vectorized by setting the width to 1. | |
bool | allowVectorization (Function *F, Loop *L, bool VectorizeOnlyWhenForced) const |
void | emitRemarkWithHints () const |
Dumps all the hint information. | |
ElementCount | getWidth () const |
unsigned | getInterleave () const |
unsigned | getIsVectorized () const |
unsigned | getPredicate () const |
enum ForceKind | getForce () const |
bool | isScalableVectorizationDisabled () const |
const char * | vectorizeAnalysisPassName () const |
If hints are provided that force vectorization, use the AlwaysPrint pass name to force the frontend to print the diagnostic. | |
bool | allowReordering () const |
When enabling loop hints are provided we allow the vectorizer to change the order of operations that is given by the scalar loop. | |
bool | isPotentiallyUnsafe () const |
void | setPotentiallyUnsafe () |
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 60 of file LoopVectorizationLegality.h.
◆ ForceKind
Enumerator | |
---|---|
FK_Undefined | Not selected. |
FK_Disabled | Forcing disabled. |
FK_Enabled | Forcing enabled. |
Definition at line 107 of file LoopVectorizationLegality.h.
◆ ScalableForceKind
Enumerator | |
---|---|
SK_Unspecified | Not selected. |
SK_FixedWidthOnly | Disables vectorization with scalable vectors. |
SK_PreferScalable | Vectorize loops using scalable vectors or fixed-width vectors, but favor scalable vectors when the cost-model is inconclusive. This is the default when the scalable.enable hint is enabled through a pragma. |
Definition at line 113 of file LoopVectorizationLegality.h.
Definition at line 107 of file LoopVectorizationLegality.cpp.
References llvm::dbgs(), llvm::TargetTransformInfo::enableScalableVectorization(), ForceScalableVectorization, llvm::ElementCount::getFixed(), getInterleave(), getWidth(), llvm::VectorizerParams::isInterleaveForced(), LLVM_DEBUG, SK_FixedWidthOnly, SK_PreferScalable, SK_Unspecified, and llvm::VectorizerParams::VectorizationInterleave.
◆ allowReordering()
bool llvm::LoopVectorizeHints::allowReordering | ( | ) | const |
---|
◆ allowVectorization()
bool llvm::LoopVectorizeHints::allowVectorization | ( | Function * | F, |
---|---|---|---|
Loop * | L, | ||
bool | VectorizeOnlyWhenForced | ||
) | const |
◆ emitRemarkWithHints()
void llvm::LoopVectorizeHints::emitRemarkWithHints | ( | ) | const |
---|
◆ getForce()
enum ForceKind llvm::LoopVectorizeHints::getForce ( ) const | inline |
---|
◆ getInterleave()
unsigned llvm::LoopVectorizeHints::getInterleave ( ) const | inline |
---|
◆ getIsVectorized()
unsigned llvm::LoopVectorizeHints::getIsVectorized ( ) const | inline |
---|
◆ getPredicate()
unsigned llvm::LoopVectorizeHints::getPredicate ( ) const | inline |
---|
◆ getWidth()
ElementCount llvm::LoopVectorizeHints::getWidth ( ) const | inline |
---|
◆ isPotentiallyUnsafe()
bool llvm::LoopVectorizeHints::isPotentiallyUnsafe ( ) const | inline |
---|
◆ isScalableVectorizationDisabled()
bool llvm::LoopVectorizeHints::isScalableVectorizationDisabled ( ) const | inline |
---|
◆ setAlreadyVectorized()
void llvm::LoopVectorizeHints::setAlreadyVectorized | ( | ) |
---|
Mark the loop L as already vectorized by setting the width to 1.
Definition at line 163 of file LoopVectorizationLegality.cpp.
References llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::MDString::get(), llvm::BasicBlock::getContext(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::Loop::getLoopID(), llvm::makePostTransformationMetadata(), llvm::Loop::setLoopID(), and llvm::Twine::str().
Referenced by llvm::LoopVectorizationPlanner::executePlan(), llvm::LoopVectorizePass::processLoop(), and processLoopInVPlanNativePath().
◆ setPotentiallyUnsafe()
void llvm::LoopVectorizeHints::setPotentiallyUnsafe ( ) | inline |
---|
◆ vectorizeAnalysisPassName()
const char * llvm::LoopVectorizeHints::vectorizeAnalysisPassName | ( | ) | const |
---|
If hints are provided that force vectorization, use the AlwaysPrint pass name to force the frontend to print the diagnostic.
Definition at line 240 of file LoopVectorizationLegality.cpp.
References llvm::OptimizationRemarkAnalysis::AlwaysPrint, FK_Disabled, FK_Undefined, llvm::ElementCount::getFixed(), getForce(), getWidth(), isZero(), and LV_NAME.
Referenced by allowVectorization(), llvm::LoopVectorizePass::processLoop(), and llvm::reportVectorizationFailure().
The documentation for this class was generated from the following files:
- include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
- lib/Transforms/Vectorize/LoopVectorizationLegality.cpp