LLVM 24.0.0git
llvm::MonotonicDescriptor Class Reference

A struct for saving information about monotonic variables. More...

#include "llvm/Analysis/IVDescriptors.h"

Public Member Functions

 MonotonicDescriptor ()=default
PHINodegetHeaderPHI () const
 Returns the header PHI described by this descriptor.
PHINodegetBackedgePHI () const
 Returns the backedge PHI that selects between StepInst and the HeaderPHI.
InstructiongetStepInst () const
 Returns the instruction that updates the value of the monotonic PHI.
const SCEVgetStartSCEV () const
 Returns a SCEV expression for the initial value of the monotonic PHI.
const SCEVgetStepSCEV () const
 Returns a SCEV expression for the step of the monotonic PHI.
unsigned getSCEVNoWrapFlags () const
 Returns the SCEV no-wrap flags that apply to StepInst.

Static Public Member Functions

static LLVM_ABI bool isMonotonicPHI (PHINode *PN, const Loop *L, MonotonicDescriptor &Desc, ScalarEvolution &SE)
 Returns true if PN is a monotonic variable in the loop L.

Detailed Description

A struct for saving information about monotonic variables.

Monotonic variable can be considered as a "conditional" induction variable: its update happens only on loop iterations for which a certain predicate is satisfied. The step of the monotonic variable must be loop-invariant.

Definition at line 489 of file IVDescriptors.h.

Constructor & Destructor Documentation

◆ MonotonicDescriptor()

llvm::MonotonicDescriptor::MonotonicDescriptor ( )
default

Member Function Documentation

◆ getBackedgePHI()

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

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

Definition at line 504 of file IVDescriptors.h.

◆ getHeaderPHI()

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

Returns the header PHI described by this descriptor.

Definition at line 501 of file IVDescriptors.h.

◆ getSCEVNoWrapFlags()

unsigned llvm::MonotonicDescriptor::getSCEVNoWrapFlags ( ) const
inline

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

Definition at line 518 of file IVDescriptors.h.

◆ getStartSCEV()

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

Returns a SCEV expression for the initial value of the monotonic PHI.

Definition at line 510 of file IVDescriptors.h.

◆ getStepInst()

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

Returns the instruction that updates the value of the monotonic PHI.

Definition at line 507 of file IVDescriptors.h.

◆ getStepSCEV()

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

Returns a SCEV expression for the step of the monotonic PHI.

This is the value the monotonic PHI increments by on loop iterations where the predicate is satisfied.

Definition at line 515 of file IVDescriptors.h.

◆ isMonotonicPHI()


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