LLVM
8.0.1
|
A struct for saving information about induction variables. More...
#include "llvm/Analysis/IVDescriptors.h"
Public Types | |
enum | InductionKind { IK_NoInduction, IK_IntInduction, IK_PtrInduction, IK_FpInduction } |
This enum represents the kinds of inductions that we support. More... | |
Public Member Functions | |
InductionDescriptor ()=default | |
Default constructor - creates an invalid induction. More... | |
int | getConsecutiveDirection () const |
Get the consecutive direction. More... | |
Value * | getStartValue () const |
InductionKind | getKind () const |
const SCEV * | getStep () const |
BinaryOperator * | getInductionBinOp () const |
ConstantInt * | getConstIntStepValue () const |
bool | hasUnsafeAlgebra () |
Returns true if the induction type is FP and the binary operator does not have the "fast-math" property. More... | |
Instruction * | getUnsafeAlgebraInst () |
Returns induction operator that does not have "fast-math" property and requires FP unsafe mode. More... | |
Instruction::BinaryOps | getInductionOpcode () const |
Returns binary opcode of the induction operator. More... | |
const SmallVectorImpl< Instruction * > & | getCastInsts () const |
Returns a reference to the type cast instructions in the induction update chain, that are redundant when guarded with a runtime SCEV overflow check. More... | |
Static Public Member Functions | |
static bool | isInductionPHI (PHINode *Phi, const Loop *L, ScalarEvolution *SE, InductionDescriptor &D, const SCEV *Expr=nullptr, SmallVectorImpl< Instruction *> *CastsToIgnore=nullptr) |
Returns true if Phi is an induction in the loop L . More... | |
static bool | isFPInductionPHI (PHINode *Phi, const Loop *L, ScalarEvolution *SE, InductionDescriptor &D) |
Returns true if Phi is a floating point induction in the loop L . More... | |
static bool | isInductionPHI (PHINode *Phi, const Loop *L, PredicatedScalarEvolution &PSE, InductionDescriptor &D, bool Assume=false) |
Returns true if Phi is a loop L induction, in the context associated with the run-time predicate of PSE. More... | |
A struct for saving information about induction variables.
Definition at line 254 of file IVDescriptors.h.
This enum represents the kinds of inductions that we support.
Definition at line 257 of file IVDescriptors.h.
|
default |
Default constructor - creates an invalid induction.
Referenced by llvm::RecurrenceDescriptor::getRecurrenceBinOp().
|
inline |
Returns a reference to the type cast instructions in the induction update chain, that are redundant when guarded with a runtime SCEV overflow check.
Definition at line 332 of file IVDescriptors.h.
Referenced by llvm::LoopVectorizationPlanner::collectTriviallyDeadInstructions(), llvm::LoopVectorizationCostModel::collectValuesToIgnore(), llvm::LoopVectorizationLegality::isUniform(), and llvm::InnerLoopVectorizer::recordVectorLoopValueForInductionCast().
int InductionDescriptor::getConsecutiveDirection | ( | ) | const |
Get the consecutive direction.
Returns: 0 - unknown or non-consecutive. 1 - consecutive and increasing. -1 - consecutive and decreasing.
Definition at line 809 of file IVDescriptors.cpp.
References llvm::ConstantInt::getSExtValue(), llvm::ConstantInt::isMinusOne(), and llvm::ConstantInt::isOne().
ConstantInt * InductionDescriptor::getConstIntStepValue | ( | ) | const |
Definition at line 816 of file IVDescriptors.cpp.
References llvm::dyn_cast().
Referenced by llvm::InnerLoopVectorizer::emitTransformedIndex(), and llvm::LoopVectorizationLegality::isUniform().
|
inline |
Definition at line 277 of file IVDescriptors.h.
References D.
Referenced by llvm::InnerLoopVectorizer::emitTransformedIndex().
|
inline |
Returns binary opcode of the induction operator.
Definition at line 324 of file IVDescriptors.h.
Referenced by llvm::InnerLoopVectorizer::buildScalarSteps().
|
inline |
Definition at line 275 of file IVDescriptors.h.
Referenced by llvm::InnerLoopVectorizer::emitTransformedIndex(), llvm::LoopVectorizationLegality::isUniform(), llvm::VPRecipeBuilder::tryToOptimizeInduction(), and llvm::VPlanHCFGTransforms::VPInstructionsToVPRecipes().
|
inline |
Definition at line 274 of file IVDescriptors.h.
Referenced by llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::InnerLoopVectorizer::emitTransformedIndex(), and llvm::LoopVectorizationLegality::isUniform().
Definition at line 276 of file IVDescriptors.h.
Referenced by llvm::InnerLoopVectorizer::createVectorizedLoopSkeleton(), llvm::InnerLoopVectorizer::emitTransformedIndex(), and llvm::InnerLoopVectorizer::fixupIVUsers().
|
inline |
Returns induction operator that does not have "fast-math" property and requires FP unsafe mode.
Definition at line 317 of file IVDescriptors.h.
Referenced by llvm::LoopVectorizationLegality::isUniform().
|
inline |
Returns true if the induction type is FP and the binary operator does not have the "fast-math" property.
Such operation requires a relaxed FP mode.
Definition at line 311 of file IVDescriptors.h.
Referenced by llvm::LoopVectorizationLegality::isUniform().
|
static |
Returns true if Phi
is a floating point induction in the loop L
.
If Phi
is an induction, the induction descriptor D
will contain the data describing this induction.
Definition at line 822 of file IVDescriptors.cpp.
References assert(), llvm::LoopBase< BlockT, LoopT >::contains(), llvm::dyn_cast(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::PHINode::getNumIncomingValues(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Value::getType(), llvm::ScalarEvolution::getUnknown(), I, and llvm::Type::isFloatingPointTy().
|
static |
Returns true if Phi
is an induction in the loop L
.
If Phi
is an induction, the induction descriptor D
will contain the data describing this induction. If by some other means the caller has a better SCEV expression for Phi
than the one returned by the ScalarEvolution analysis, it can be passed through Expr
. If the def-use chain associated with the phi includes casts (that we know we can ignore under proper runtime checks), they are passed through CastsToIgnore
.
Definition at line 1024 of file IVDescriptors.cpp.
References assert(), llvm::dbgs(), llvm::dyn_cast(), llvm::ScalarEvolution::getConstant(), llvm::Module::getDataLayout(), llvm::PHINode::getIncomingValueForBlock(), llvm::SCEVAddRecExpr::getLoop(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::Instruction::getModule(), llvm::Type::getPointerElementType(), llvm::ScalarEvolution::getSCEV(), llvm::ConstantInt::getSExtValue(), llvm::SCEVAddRecExpr::getStepRecurrence(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::SCEVConstant::getValue(), llvm::Type::isIntegerTy(), llvm::ScalarEvolution::isLoopInvariant(), llvm::Type::isPointerTy(), llvm::Type::isSized(), LLVM_DEBUG, and Size.
Referenced by findInnerReductionPhi(), and llvm::LoopVectorizationLegality::isUniform().
|
static |
Returns true if Phi
is a loop L
induction, in the context associated with the run-time predicate of PSE.
If Assume
is true, this can add further SCEV predicates to PSE
in order to prove that Phi
is an induction. If Phi
is an induction, D
will contain the data describing this induction.
Definition at line 980 of file IVDescriptors.cpp.
References D, llvm::dbgs(), llvm::dyn_cast(), llvm::PredicatedScalarEvolution::getAsAddRec(), getCastsForInductionPHI(), llvm::PredicatedScalarEvolution::getSCEV(), llvm::PredicatedScalarEvolution::getSE(), llvm::Value::getType(), llvm::Type::isDoubleTy(), llvm::Type::isFloatingPointTy(), llvm::Type::isFloatTy(), llvm::Type::isHalfTy(), llvm::Type::isIntegerTy(), llvm::Type::isPointerTy(), and LLVM_DEBUG.