|
LLVM
10.0.0
|
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 char * | vectorizeAnalysisPassName () 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 () |
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.
| Enumerator | |
|---|---|
| FK_Undefined | Not selected. |
| FK_Disabled | Forcing disabled. |
| FK_Enabled | Forcing enabled. |
Definition at line 83 of file LoopVectorizationLegality.h.
| llvm::LoopVectorizeHints::LoopVectorizeHints | ( | const Loop * | L, |
| bool | InterleaveOnlyWhenForced, | ||
| OptimizationRemarkEmitter & | ORE | ||
| ) |
Definition at line 68 of file LoopVectorizationLegality.cpp.
References llvm::dbgs(), llvm::VectorizerParams::isInterleaveForced(), LLVM_DEBUG, and llvm::VectorizerParams::VectorizationInterleave.
|
inline |
Definition at line 116 of file LoopVectorizationLegality.h.
References FK_Enabled, getForce(), and getWidth().
Referenced by llvm::LoopVectorizationRequirements::doesNotMeet().
| bool llvm::LoopVectorizeHints::allowVectorization | ( | Function * | F, |
| Loop * | L, | ||
| bool | VectorizeOnlyWhenForced | ||
| ) | const |
Definition at line 112 of file LoopVectorizationLegality.cpp.
References llvm::dbgs(), llvm::OptimizationRemarkEmitter::emit(), emitRemarkWithHints(), FK_Disabled, FK_Enabled, getForce(), llvm::LoopBase< BlockT, LoopT >::getHeader(), getIsVectorized(), llvm::Loop::getStartLoc(), LLVM_DEBUG, and vectorizeAnalysisPassName().
| void llvm::LoopVectorizeHints::emitRemarkWithHints | ( | ) | const |
Dumps all the hint information.
Definition at line 145 of file LoopVectorizationLegality.cpp.
References FK_Disabled, FK_Enabled, and LV_NAME.
Referenced by allowVectorization().
|
inline |
Definition at line 105 of file LoopVectorizationLegality.h.
References FK_Disabled, FK_Undefined, llvm::hasDisableAllTransformsHint(), and vectorizeAnalysisPassName().
Referenced by allowReordering(), allowVectorization(), llvm::InnerLoopVectorizer::emitMemRuntimeChecks(), getScalarEpilogueLowering(), isPotentiallyUnsafe(), and vectorizeAnalysisPassName().
|
inline |
Definition at line 102 of file LoopVectorizationLegality.h.
|
inline |
Definition at line 103 of file LoopVectorizationLegality.h.
Referenced by allowVectorization().
|
inline |
Definition at line 104 of file LoopVectorizationLegality.h.
Referenced by getScalarEpilogueLowering().
|
inline |
Definition at line 101 of file LoopVectorizationLegality.h.
Referenced by allowReordering(), processLoopInVPlanNativePath(), and vectorizeAnalysisPassName().
|
inline |
Definition at line 125 of file LoopVectorizationLegality.h.
References FK_Enabled, and getForce().
| void llvm::LoopVectorizeHints::setAlreadyVectorized | ( | ) |
Mark the loop L as already vectorized by setting the width to 1.
Definition at line 93 of file LoopVectorizationLegality.cpp.
References Context, llvm::ConstantInt::get(), llvm::ConstantAsMetadata::get(), llvm::MDString::get(), llvm::MDNode::get(), llvm::BasicBlock::getContext(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::Loop::getLoopID(), llvm::makePostTransformationMetadata(), llvm::Loop::setLoopID(), and llvm::Twine::str().
Referenced by llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), and processLoopInVPlanNativePath().
|
inline |
Definition at line 134 of file LoopVectorizationLegality.h.
If hints are provided that force vectorization, use the AlwaysPrint pass name to force the frontend to print the diagnostic.
Definition at line 171 of file LoopVectorizationLegality.cpp.
References llvm::OptimizationRemarkAnalysis::AlwaysPrint, Arg, llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), C, llvm::dbgs(), llvm::dyn_cast(), FK_Disabled, FK_Undefined, getForce(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), llvm::MDString::getString(), getWidth(), llvm::ConstantInt::getZExtValue(), H, LLVM_DEBUG, LV_NAME, Name, llvm::StringRef::npos, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorBase::size(), llvm::size(), llvm::StringRef::startswith(), and llvm::StringRef::substr().
Referenced by allowVectorization(), llvm::LoopVectorizationRequirements::doesNotMeet(), getForce(), and llvm::reportVectorizationFailure().
1.8.13