|
LLVM 23.0.0git
|
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. | |
| Value * | getStartValue () const |
| InductionKind | getKind () const |
| const SCEV * | getStep () const |
| BinaryOperator * | getInductionBinOp () const |
| LLVM_ABI ConstantInt * | getConstIntStepValue () const |
| Instruction * | getExactFPMathInst () |
| Returns floating-point induction operator that does not allow reassociation (transforming the induction requires an override of normal floating-point rules). | |
| Instruction::BinaryOps | getInductionOpcode () const |
| Returns binary opcode of the induction operator. | |
| ArrayRef< Instruction * > | getCastInsts () const |
| Returns an ArrayRef to the type cast instructions in the induction update chain, that are redundant when guarded with a runtime SCEV overflow check. | |
Static Public Member Functions | |
| static LLVM_ABI 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. | |
| static LLVM_ABI bool | isFPInductionPHI (PHINode *Phi, const Loop *L, ScalarEvolution *SE, InductionDescriptor &D) |
Returns true if Phi is a floating point induction in the loop L. | |
| static LLVM_ABI 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. | |
A struct for saving information about induction variables.
Definition at line 414 of file IVDescriptors.h.
This enum represents the kinds of inductions that we support.
Definition at line 417 of file IVDescriptors.h.
|
default |
Default constructor - creates an invalid induction.
Referenced by isFPInductionPHI(), isInductionPHI(), and isInductionPHI().
|
inline |
Returns an ArrayRef to the type cast instructions in the induction update chain, that are redundant when guarded with a runtime SCEV overflow check.
Definition at line 485 of file IVDescriptors.h.
Referenced by llvm::LoopVectorizationCostModel::collectValuesToIgnore().
| ConstantInt * InductionDescriptor::getConstIntStepValue | ( | ) | const |
Definition at line 1456 of file IVDescriptors.cpp.
References llvm::cast(), llvm::dyn_cast(), and llvm::isa().
Referenced by llvm::Loop::isCanonical().
|
inline |
Returns floating-point induction operator that does not allow reassociation (transforming the induction requires an override of normal floating-point rules).
Definition at line 469 of file IVDescriptors.h.
References IK_FpInduction.
Referenced by llvm::LoopVectorizationLegality::canVectorizeFPMath().
|
inline |
Definition at line 431 of file IVDescriptors.h.
Referenced by llvm::Loop::LoopBounds::getBounds().
|
inline |
Returns binary opcode of the induction operator.
Definition at line 477 of file IVDescriptors.h.
Referenced by llvm::Loop::isAuxiliaryInductionVariable(), and llvm::Loop::isCanonical().
|
inline |
Definition at line 429 of file IVDescriptors.h.
Referenced by createWidenInductionRecipe().
|
inline |
Definition at line 428 of file IVDescriptors.h.
Referenced by createWidenInductionRecipe(), llvm::Loop::LoopBounds::getBounds(), and llvm::Loop::isCanonical().
Definition at line 430 of file IVDescriptors.h.
Referenced by createWidenInductionRecipe(), llvm::Loop::LoopBounds::getBounds(), and llvm::Loop::isAuxiliaryInductionVariable().
|
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 1462 of file IVDescriptors.cpp.
References assert(), llvm::LoopBase< BlockT, LoopT >::contains(), D(), llvm::dyn_cast(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::BinaryOperator::getOpcode(), llvm::User::getOperand(), llvm::ScalarEvolution::getUnknown(), I, IK_FpInduction, and InductionDescriptor().
Referenced by isInductionPHI().
|
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 1620 of file IVDescriptors.cpp.
References D(), llvm::dbgs(), llvm::dyn_cast(), llvm::PredicatedScalarEvolution::getAsAddRec(), getCastsForInductionPHI(), llvm::PredicatedScalarEvolution::getSCEV(), llvm::PredicatedScalarEvolution::getSE(), InductionDescriptor(), llvm::Type::isDoubleTy(), llvm::Type::isFloatingPointTy(), llvm::Type::isFloatTy(), isFPInductionPHI(), llvm::Type::isHalfTy(), isInductionPHI(), llvm::Type::isIntegerTy(), llvm::Type::isPointerTy(), and LLVM_DEBUG.
|
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. Since Induction Phis can only be present inside loop headers, the function will assert if it is passed a Phi whose parent is not the loop header. 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 1664 of file IVDescriptors.cpp.
References assert(), D(), llvm::dbgs(), llvm::dyn_cast(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::ScalarEvolution::getSCEV(), IK_IntInduction, IK_PtrInduction, InductionDescriptor(), llvm::Type::isIntegerTy(), llvm::Type::isPointerTy(), llvm::ScalarEvolution::isSCEVable(), LLVM_DEBUG, llvm::SCEVPatternMatch::m_SCEV(), llvm::SCEVPatternMatch::m_scev_AffineAddRec(), llvm::SCEVPatternMatch::m_SpecificLoop(), and llvm::PatternMatch::match().
Referenced by checkIsIndPhi(), llvm::Loop::LoopBounds::getBounds(), llvm::Loop::getInductionDescriptor(), llvm::Loop::getInductionVariable(), llvm::Loop::isAuxiliaryInductionVariable(), and isInductionPHI().