class InductionDescriptor

Declaration

class InductionDescriptor { /* full declaration omitted */ };

Description

A struct for saving information about induction variables.

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:303

Member Variables

private TrackingVH<llvm::Value> StartValue
Start value.
private llvm::InductionDescriptor::InductionKind IK = IK_NoInduction
Induction kind.
private const llvm::SCEV* Step = nullptr
Step value.
private llvm::BinaryOperator* InductionBinOp = nullptr
private llvm::Type* ElementType = nullptr
private SmallVector<llvm::Instruction*, 2> RedundantCasts

Method Overview

  • public InductionDescriptor()
  • private InductionDescriptor(llvm::Value * Start, llvm::InductionDescriptor::InductionKind K, const llvm::SCEV * Step, llvm::BinaryOperator * InductionBinOp = nullptr, llvm::Type * ElementType = nullptr, SmallVectorImpl<llvm::Instruction *> * Casts = nullptr)
  • public const SmallVectorImpl<llvm::Instruction *> & getCastInsts() const
  • public llvm::ConstantInt * getConstIntStepValue() const
  • public llvm::Type * getElementType() const
  • public llvm::Instruction * getExactFPMathInst()
  • public llvm::BinaryOperator * getInductionBinOp() const
  • public Instruction::BinaryOps getInductionOpcode() const
  • public llvm::InductionDescriptor::InductionKind getKind() const
  • public llvm::Value * getStartValue() const
  • public const llvm::SCEV * getStep() const
  • public static bool isFPInductionPHI(llvm::PHINode * Phi, const llvm::Loop * L, llvm::ScalarEvolution * SE, llvm::InductionDescriptor & D)
  • public static bool isInductionPHI(llvm::PHINode * Phi, const llvm::Loop * L, llvm::ScalarEvolution * SE, llvm::InductionDescriptor & D, const llvm::SCEV * Expr = nullptr, SmallVectorImpl<llvm::Instruction *> * CastsToIgnore = nullptr)
  • public static bool isInductionPHI(llvm::PHINode * Phi, const llvm::Loop * L, llvm::PredicatedScalarEvolution & PSE, llvm::InductionDescriptor & D, bool Assume = false)

Methods

InductionDescriptor()

Description

Default constructor - creates an invalid induction.

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:315

InductionDescriptor(
    llvm::Value* Start,
    llvm::InductionDescriptor::InductionKind K,
    const llvm::SCEV* Step,
    llvm::BinaryOperator* InductionBinOp =
        nullptr,
    llvm::Type* ElementType = nullptr,
    SmallVectorImpl<llvm::Instruction*>* Casts =
        nullptr)

Description

Private constructor - used by \c isInductionPHI.

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:381

Parameters

llvm::Value* Start
llvm::InductionDescriptor::InductionKind K
const llvm::SCEV* Step
llvm::BinaryOperator* InductionBinOp = nullptr
llvm::Type* ElementType = nullptr
SmallVectorImpl<llvm::Instruction*>* Casts = nullptr

const SmallVectorImpl<llvm::Instruction*>&
getCastInsts() const

Description

Returns a reference to the type cast instructions in the induction update chain, that are redundant when guarded with a runtime SCEV overflow check.

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:375

llvm::ConstantInt* getConstIntStepValue() const

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:321

llvm::Type* getElementType() const

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:367

llvm::Instruction* getExactFPMathInst()

Description

Returns floating-point induction operator that does not allow reassociation (transforming the induction requires an override of normal floating-point rules).

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:354

llvm::BinaryOperator* getInductionBinOp() const

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:320

Instruction::BinaryOps getInductionOpcode() const

Description

Returns binary opcode of the induction operator.

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:362

llvm::InductionDescriptor::InductionKind getKind()
    const

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:318

llvm::Value* getStartValue() const

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:317

const llvm::SCEV* getStep() const

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:319

static bool isFPInductionPHI(
    llvm::PHINode* Phi,
    const llvm::Loop* L,
    llvm::ScalarEvolution* SE,
    llvm::InductionDescriptor& D)

Description

Returns true if \p Phi is a floating point induction in the loop \p L. If \p Phi is an induction, the induction descriptor \p D will contain the data describing this induction.

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:338

Parameters

llvm::PHINode* Phi
const llvm::Loop* L
llvm::ScalarEvolution* SE
llvm::InductionDescriptor& D

static bool isInductionPHI(
    llvm::PHINode* Phi,
    const llvm::Loop* L,
    llvm::ScalarEvolution* SE,
    llvm::InductionDescriptor& D,
    const llvm::SCEV* Expr = nullptr,
    SmallVectorImpl<llvm::Instruction*>*
        CastsToIgnore = nullptr)

Description

Returns true if \p Phi is an induction in the loop \p L. If \p Phi is an induction, the induction descriptor \p D will contain the data describing this induction. If by some other means the caller has a better SCEV expression for \p Phi than the one returned by the ScalarEvolution analysis, it can be passed through \p 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 \p CastsToIgnore.

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:331

Parameters

llvm::PHINode* Phi
const llvm::Loop* L
llvm::ScalarEvolution* SE
llvm::InductionDescriptor& D
const llvm::SCEV* Expr = nullptr
SmallVectorImpl<llvm::Instruction*>* CastsToIgnore = nullptr

static bool isInductionPHI(
    llvm::PHINode* Phi,
    const llvm::Loop* L,
    llvm::PredicatedScalarEvolution& PSE,
    llvm::InductionDescriptor& D,
    bool Assume = false)

Description

Returns true if \p Phi is a loop \p L induction, in the context associated with the run-time predicate of PSE. If \p Assume is true, this can add further SCEV predicates to \p PSE in order to prove that \p Phi is an induction. If \p Phi is an induction, \p D will contain the data describing this induction.

Declared at: llvm/include/llvm/Analysis/IVDescriptors.h:347

Parameters

llvm::PHINode* Phi
const llvm::Loop* L
llvm::PredicatedScalarEvolution& PSE
llvm::InductionDescriptor& D
bool Assume = false