LLVM API Documentation

llvm::SCEVAddRecExpr Class Reference

#include <ScalarEvolutionExpressions.h>

Inheritance diagram for llvm::SCEVAddRecExpr:
[legend]
Collaboration diagram for llvm::SCEVAddRecExpr:
[legend]

List of all members.

Public Types

typedef std::vector
< SCEVHandle >::const_iterator 
op_iterator

Public Member Functions

op_iterator op_begin () const
op_iterator op_end () const
unsigned getNumOperands () const
const SCEVHandle & getOperand (unsigned i) const
const SCEVHandle & getStart () const
const Loop * getLoop () const
SCEVHandle getStepRecurrence (ScalarEvolution &SE) const
virtual bool hasComputableLoopEvolution (const Loop *QL) const
virtual bool isLoopInvariant (const Loop *QueryLoop) const
virtual const Type * getType () const
bool isAffine () const
bool isQuadratic () const
SCEVHandle evaluateAtIteration (SCEVHandle It, ScalarEvolution &SE) const
SCEVHandle getNumIterationsInRange (ConstantRange Range, ScalarEvolution &SE) const
SCEVHandle replaceSymbolicValuesWithConcrete (const SCEVHandle &Sym, const SCEVHandle &Conc, ScalarEvolution &SE) const
virtual void print (std::ostream &OS) const
void print (std::ostream *OS) const

Static Public Member Functions

static bool classof (const SCEVAddRecExpr *S)
 Methods for support type inquiry through isa, cast, and dyn_cast:.
static bool classof (const SCEV *S)

Friends

class ScalarEvolution


Detailed Description

SCEVAddRecExpr - This node represents a polynomial recurrence on the trip count of the specified loop.

All operands of an AddRec are required to be loop invariant.

Definition at line 366 of file ScalarEvolutionExpressions.h.


Member Typedef Documentation

typedef std::vector<SCEVHandle>::const_iterator llvm::SCEVAddRecExpr::op_iterator

Definition at line 380 of file ScalarEvolutionExpressions.h.


Member Function Documentation

op_iterator llvm::SCEVAddRecExpr::op_begin (  )  const [inline]

op_iterator llvm::SCEVAddRecExpr::op_end (  )  const [inline]

unsigned llvm::SCEVAddRecExpr::getNumOperands (  )  const [inline]

const SCEVHandle& llvm::SCEVAddRecExpr::getOperand ( unsigned  i  )  const [inline]

const SCEVHandle& llvm::SCEVAddRecExpr::getStart (  )  const [inline]

const Loop* llvm::SCEVAddRecExpr::getLoop (  )  const [inline]

SCEVHandle llvm::SCEVAddRecExpr::getStepRecurrence ( ScalarEvolution &  SE  )  const [inline]

getStepRecurrence - This method 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.

Definition at line 393 of file ScalarEvolutionExpressions.h.

References llvm::ScalarEvolution::getAddRecExpr(), getLoop(), getOperand(), isAffine(), op_begin(), and op_end().

Referenced by llvm::ScalarEvolution::getMulExpr().

virtual bool llvm::SCEVAddRecExpr::hasComputableLoopEvolution ( const Loop *  L  )  const [inline, virtual]

hasComputableLoopEvolution - Return true if this SCEV changes value in a known way in the specified loop. This property being true implies that the value is variant in the loop AND that we can emit an expression to compute the value of the expression at any particular loop iteration.

Implements llvm::SCEV.

Definition at line 399 of file ScalarEvolutionExpressions.h.

References L.

bool SCEVAddRecExpr::isLoopInvariant ( const Loop *  L  )  const [virtual]

isLoopInvariant - Return true if the value of this SCEV is unchanging in the specified loop.

Implements llvm::SCEV.

Definition at line 364 of file ScalarEvolution.cpp.

References llvm::LoopBase< BlockT >::contains(), llvm::LoopBase< BlockT >::getHeader(), getOperand(), and L.

virtual const Type* llvm::SCEVAddRecExpr::getType (  )  const [inline, virtual]

getType - Return the LLVM type of this SCEV expression.

Implements llvm::SCEV.

Definition at line 406 of file ScalarEvolutionExpressions.h.

Referenced by evaluateAtIteration(), getNumIterationsInRange(), and llvm::SCEVExpander::visitAddRecExpr().

bool llvm::SCEVAddRecExpr::isAffine (  )  const [inline]

isAffine - Return true if this is an affine AddRec (i.e., it represents an expressions A+B*x where A and B are loop invariant values.

Definition at line 410 of file ScalarEvolutionExpressions.h.

References getNumOperands().

Referenced by getNumIterationsInRange(), getSCEVStartAndStride(), getStepRecurrence(), and llvm::SCEVExpander::visitAddRecExpr().

bool llvm::SCEVAddRecExpr::isQuadratic (  )  const [inline]

isQuadratic - Return true if this is an quadratic AddRec (i.e., it represents an expressions 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}

Definition at line 419 of file ScalarEvolutionExpressions.h.

References getNumOperands().

Referenced by getNumIterationsInRange().

SCEVHandle SCEVAddRecExpr::evaluateAtIteration ( SCEVHandle  It,
ScalarEvolution &  SE 
) const

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

evaluateAtIteration - Return the value of this chain of recurrences at the specified iteration number. We can evaluate this recurrence by multiplying each element in the chain by the binomial coefficient corresponding to it. In other words, we can evaluate {A,+,B,+,C,+,D} as:

A*BC(It, 0) + B*BC(It, 1) + C*BC(It, 2) + D*BC(It, 3)

where BC(It, k) stands for binomial coefficient.

Definition at line 638 of file ScalarEvolution.cpp.

References BinomialCoefficient(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getMulExpr(), getNumOperands(), getOperand(), getStart(), and getType().

Referenced by EvaluateConstantChrecAtConstant(), and llvm::SCEVExpander::visitAddRecExpr().

SCEVHandle SCEVAddRecExpr::getNumIterationsInRange ( ConstantRange  Range,
ScalarEvolution &  SE 
) const

getNumIterationsInRange - 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.

getNumIterationsInRange - 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.

Definition at line 2857 of file ScalarEvolution.cpp.

References A, llvm::ConstantRange::contains(), llvm::dyn_cast(), EvaluateConstantChrecAtConstant(), llvm::ConstantInt::get(), llvm::ScalarEvolution::getAddRecExpr(), llvm::SCEV::getBitWidth(), llvm::ScalarEvolution::getConstant(), llvm::ConstantExpr::getICmp(), llvm::ScalarEvolution::getIntegerSCEV(), getLoop(), llvm::ConstantRange::getLower(), llvm::ScalarEvolution::getNegativeSCEV(), getNumOperands(), getOperand(), getStart(), getType(), llvm::ConstantRange::getUpper(), llvm::SCEVConstant::getValue(), llvm::ConstantInt::getValue(), llvm::CmpInst::ICMP_ULT, isAffine(), llvm::ConstantRange::isFullSet(), isQuadratic(), op_begin(), op_end(), llvm::APInt::sge(), SolveQuadraticEquation(), llvm::ConstantRange::subtract(), std::swap(), and llvm::APIntOps::udiv().

SCEVHandle SCEVAddRecExpr::replaceSymbolicValuesWithConcrete ( const SCEVHandle &  Sym,
const SCEVHandle &  Conc,
ScalarEvolution &  SE 
) const [virtual]

replaceSymbolicValuesWithConcrete - If this SCEV internally references the symbolic value "Sym", construct and return a new SCEV that produces the same value, but which uses the concrete value Conc instead of the symbolic value. If this SCEV does not use the symbolic value, it returns itself.

Implements llvm::SCEV.

Definition at line 341 of file ScalarEvolution.cpp.

References llvm::ScalarEvolution::getAddRecExpr(), getNumOperands(), getOperand(), H, and L.

void SCEVAddRecExpr::print ( std::ostream &  OS  )  const [virtual]

print - Print out the internal representation of this scalar to the specified stream. This should really only be used for debugging purposes.

Implements llvm::SCEV.

Definition at line 372 of file ScalarEvolution.cpp.

References llvm::LoopBase< BlockT >::getHeader(), and L.

Referenced by print().

void llvm::SCEVAddRecExpr::print ( std::ostream *  OS  )  const [inline]

Reimplemented from llvm::SCEV.

Definition at line 441 of file ScalarEvolutionExpressions.h.

References print().

static bool llvm::SCEVAddRecExpr::classof ( const SCEVAddRecExpr *  S  )  [inline, static]

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

Definition at line 444 of file ScalarEvolutionExpressions.h.

static bool llvm::SCEVAddRecExpr::classof ( const SCEV *  S  )  [inline, static]

Definition at line 445 of file ScalarEvolutionExpressions.h.

References llvm::SCEV::getSCEVType(), and llvm::scAddRecExpr.


Friends And Related Function Documentation

friend class ScalarEvolution [friend]

Definition at line 367 of file ScalarEvolutionExpressions.h.


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