LLVM 24.0.0git
llvm::ConditionalInductionDescriptor Class Reference

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ ConditionalInductionDescriptor()

llvm::ConditionalInductionDescriptor::ConditionalInductionDescriptor ( )
default

Member Function Documentation

◆ getBackedgePHI()

PHINode * llvm::ConditionalInductionDescriptor::getBackedgePHI ( ) const
inline

Returns the backedge PHI that selects between StepInst and the HeaderPHI.

Definition at line 505 of file IVDescriptors.h.

Referenced by llvm::collectCompressedPtrs().

◆ getHeaderPHI()

PHINode * llvm::ConditionalInductionDescriptor::getHeaderPHI ( ) const
inline

Returns the header PHI described by this descriptor.

Definition at line 502 of file IVDescriptors.h.

Referenced by llvm::collectCompressedPtrs().

◆ getSCEVNoWrapFlags()

SCEVFlags llvm::ConditionalInductionDescriptor::getSCEVNoWrapFlags ( ) const
inline

Returns the SCEV no-wrap flags that apply to StepInst.

Definition at line 519 of file IVDescriptors.h.

◆ getStartSCEV()

const SCEV * llvm::ConditionalInductionDescriptor::getStartSCEV ( ) const
inline

Returns a SCEV expression for the initial value of the conditional induction PHI.

Definition at line 512 of file IVDescriptors.h.

Referenced by getUnconditionalAddRec().

◆ getStepInst()

Instruction * llvm::ConditionalInductionDescriptor::getStepInst ( ) const
inline

Returns the instruction that updates the conditional induction PHI.

Definition at line 508 of file IVDescriptors.h.

◆ getStepSCEV()

const SCEV * llvm::ConditionalInductionDescriptor::getStepSCEV ( ) const
inline

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().

◆ 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().

◆ isConditionalInductionPHI()


The documentation for this class was generated from the following files: