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:296

Inherits from: SCEVNAryExpr

Member Variables

Inherited from SCEVNAryExpr:

protected Operands
protected NumOperands

Inherited from SCEV:

protected ExpressionSize
protected SubclassData = 0

Method Overview

Inherited from SCEVNAryExpr:

Inherited from SCEV:

Inherited from FoldingSetBase::Node:

Methods

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:362

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:346

Parameters

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

const llvm::Loop* getLoop() const

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

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:354

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:359

Parameters

llvm::ScalarEvolution& SE

const llvm::SCEV* getStart() const

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

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:313

Parameters

llvm::ScalarEvolution& SE

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:322

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:331

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:338

Parameters

llvm::SCEV::NoWrapFlags Flags