|
LLVM 24.0.0git
|
Describes a conditional induction variable: an induction variable that is updated only on loop iterations for which a certain predicate is satisfied. More...
#include "llvm/Analysis/IVDescriptors.h"
Public Member Functions | |
| ConditionalInductionDescriptor ()=default | |
| PHINode * | getHeaderPHI () const |
| Returns the header PHI described by this descriptor. | |
| PHINode * | getBackedgePHI () const |
| Returns the backedge PHI that selects between StepInst and the HeaderPHI. | |
| Instruction * | getStepInst () const |
| Returns the instruction that updates the conditional induction PHI. | |
| const SCEV * | getStartSCEV () const |
| Returns a SCEV expression for the initial value of the conditional induction PHI. | |
| const SCEV * | getStepSCEV () const |
| Returns a SCEV expression for the step of the conditional induction PHI. | |
| SCEVFlags | getSCEVNoWrapFlags () const |
| Returns the SCEV no-wrap flags that apply to StepInst. | |
| LLVM_ABI const SCEV * | getUnconditionalAddRec (ScalarEvolution &SE, const Loop &L) const |
| Returns an over-approximation of the conditional induction as a SCEVAddRec assuming the condition is always true. | |
Static Public Member Functions | |
| static LLVM_ABI bool | isConditionalInductionPHI (PHINode *PN, const Loop *L, ConditionalInductionDescriptor &Desc, ScalarEvolution &SE) |
Returns true if PN is a conditional induction variable in the loop L. | |
Describes a conditional induction variable: an induction variable that is updated only on loop iterations for which a certain predicate is satisfied.
Its step must be loop-invariant.
Definition at line 490 of file IVDescriptors.h.
|
default |
References ConditionalInductionDescriptor(), and LLVM_ABI.
Referenced by ConditionalInductionDescriptor(), and isConditionalInductionPHI().
|
inline |
Returns the backedge PHI that selects between StepInst and the HeaderPHI.
Definition at line 505 of file IVDescriptors.h.
Referenced by llvm::collectCompressedPtrs().
|
inline |
Returns the header PHI described by this descriptor.
Definition at line 502 of file IVDescriptors.h.
Referenced by llvm::collectCompressedPtrs().
|
inline |
Returns the SCEV no-wrap flags that apply to StepInst.
Definition at line 519 of file IVDescriptors.h.
Returns a SCEV expression for the initial value of the conditional induction PHI.
Definition at line 512 of file IVDescriptors.h.
Referenced by getUnconditionalAddRec().
|
inline |
Returns the instruction that updates the conditional induction PHI.
Definition at line 508 of file IVDescriptors.h.
Returns a SCEV expression for the step of the conditional induction PHI.
This is the value it increments by when the predicate is satisfied.
Definition at line 516 of file IVDescriptors.h.
Referenced by llvm::VPlanTransforms::createHeaderPhiRecipes(), and getUnconditionalAddRec().
| const SCEV * ConditionalInductionDescriptor::getUnconditionalAddRec | ( | ScalarEvolution & | SE, |
| const Loop & | L ) const |
Returns an over-approximation of the conditional induction as a SCEVAddRec assuming the condition is always true.
The loop L must be the loop containing the conditional induction.
Definition at line 1813 of file IVDescriptors.cpp.
References assert(), llvm::SCEV::FlagNone, llvm::ScalarEvolution::getAddRecExpr(), getStartSCEV(), and getStepSCEV().
Referenced by llvm::collectCompressedPtrs().
|
static |
Returns true if PN is a conditional induction variable in the loop L.
If it is, Desc will contain the data describing the PHI.
Definition at line 1736 of file IVDescriptors.cpp.
References llvm::cast(), ConditionalInductionDescriptor(), llvm::dbgs(), DL, llvm::dyn_cast(), llvm::find_singleton(), llvm::SCEV::FlagNone, llvm::SCEV::FlagNSW, llvm::SCEV::FlagNUW, GEP, llvm::ScalarEvolution::getDataLayout(), llvm::PHINode::getIncomingValueForBlock(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::ScalarEvolution::getSCEV(), llvm::Value::getType(), llvm::Value::hasOneUse(), llvm::Type::isIntOrPtrTy(), llvm::ScalarEvolution::isKnownNonNegative(), llvm::Type::isPointerTy(), LLVM_DEBUG, llvm::PatternMatch::m_c_Add(), llvm::PatternMatch::m_PtrAdd(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::ScalarEvolution::setFlags(), and llvm::Value::users().