class SCEVAddRecExpr

Declaration

class SCEVAddRecExpr : public SCEVNAryExpr { /* full declaration omitted */ };

Description

This node represents a polynomial recurrence on the trip count of the specified loop. This is the primary focus of the ScalarEvolution framework; all the other SCEV subclasses are mostly just supporting infrastructure to allow SCEVAddRecExpr expressions to be created and analyzed. All operands of an AddRec are required to be loop invariant.

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:342

Inherits from: SCEVNAryExpr

Member Variables

private const llvm::Loop* L

Inherited from SCEVNAryExpr:

protected Operands
protected NumOperands

Inherited from SCEV:

protected ExpressionSize
protected SubclassData = 0

Method Overview

  • private SCEVAddRecExpr(const llvm::FoldingSetNodeIDRef ID, const llvm::SCEV *const * O, size_t N, const llvm::Loop * l)
  • public static bool classof(const llvm::SCEV * S)
  • public const llvm::SCEV * evaluateAtIteration(const llvm::SCEV * It, llvm::ScalarEvolution & SE) const
  • public static const llvm::SCEV * evaluateAtIteration(ArrayRef<const llvm::SCEV *> Operands, const llvm::SCEV * It, llvm::ScalarEvolution & SE)
  • public const llvm::Loop * getLoop() const
  • public const llvm::SCEV * getNumIterationsInRange(const llvm::ConstantRange & Range, llvm::ScalarEvolution & SE) const
  • public const llvm::SCEVAddRecExpr * getPostIncExpr(llvm::ScalarEvolution & SE) const
  • public const llvm::SCEV * getStart() const
  • public const llvm::SCEV * getStepRecurrence(llvm::ScalarEvolution & SE) const
  • public llvm::Type * getType() const
  • public bool isAffine() const
  • public bool isQuadratic() const
  • public void setNoWrapFlags(llvm::SCEV::NoWrapFlags Flags)

Inherited from SCEVNAryExpr:

Inherited from SCEV:

Inherited from FoldingSetBase::Node:

Methods

SCEVAddRecExpr(const llvm::FoldingSetNodeIDRef ID,
               const llvm::SCEV* const* O,
               size_t N,
               const llvm::Loop* l)

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

Parameters

const llvm::FoldingSetNodeIDRef ID
const llvm::SCEV* const* O
size_t N
const llvm::Loop* l

static bool classof(const llvm::SCEV* S)

Description

Methods for support type inquiry through isa, cast, and dyn_cast:

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:413

Parameters

const llvm::SCEV* S

const llvm::SCEV* evaluateAtIteration(
    const llvm::SCEV* It,
    llvm::ScalarEvolution& SE) const

Description

Return the value of this chain of recurrences at the specified iteration number.

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:392

Parameters

const llvm::SCEV* It
llvm::ScalarEvolution& SE

static const llvm::SCEV* evaluateAtIteration(
    ArrayRef<const llvm::SCEV*> Operands,
    const llvm::SCEV* It,
    llvm::ScalarEvolution& SE)

Description

Return the value of this chain of recurrences at the specified iteration number. Takes an explicit list of operands to represent an AddRec.

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:396

Parameters

ArrayRef<const llvm::SCEV*> Operands
const llvm::SCEV* It
llvm::ScalarEvolution& SE

const llvm::Loop* getLoop() const

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

const llvm::SCEV* getNumIterationsInRange(
    const llvm::ConstantRange& Range,
    llvm::ScalarEvolution& SE) const

Description

Return the number of iterations of this loop that produce values in the specified constant range. Another way of looking at this is that it returns the first iteration number where the value is not in the condition, thus computing the exit count. If the iteration count can't be computed, an instance of SCEVCouldNotCompute is returned.

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:405

Parameters

const llvm::ConstantRange& Range
llvm::ScalarEvolution& SE

const llvm::SCEVAddRecExpr* getPostIncExpr(
    llvm::ScalarEvolution& SE) const

Description

Return an expression representing the value of this expression one iteration of the loop ahead.

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:410

Parameters

llvm::ScalarEvolution& SE

const llvm::SCEV* getStart() const

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:353

const llvm::SCEV* getStepRecurrence(
    llvm::ScalarEvolution& SE) const

Description

Constructs and returns the recurrence indicating how much this expression steps by. If this is a polynomial of degree N, it returns a chrec of degree N-1. We cannot determine whether the step recurrence has self-wraparound.

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:360

Parameters

llvm::ScalarEvolution& SE

llvm::Type* getType() const

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:352

bool isAffine() const

Description

Return true if this represents an expression A + B*x where A and B are loop invariant values.

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:370

bool isQuadratic() const

Description

Return true if this represents an expression A + B*x + C*x^2 where A, B and C are loop invariant values. This corresponds to an addrec of the form {L,+,M,+,N}

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:379

void setNoWrapFlags(llvm::SCEV::NoWrapFlags Flags)

Description

Set flags for a recurrence without clearing any previously set flags. For AddRec, either NUW or NSW implies NW. Keep track of this fact here to make it easier to propagate flags.

Declared at: llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h:384

Parameters

llvm::SCEV::NoWrapFlags Flags