LLVM API Documentation

llvm::SCEVAddRecExpr Class Reference

#include <ScalarEvolutionExpressions.h>

Inheritance diagram for llvm::SCEVAddRecExpr:

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

Collaboration graph
[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 SCEVHandlegetOperand (unsigned i) const
const SCEVHandlegetStart () const
const LoopgetLoop () const
SCEVHandle getStepRecurrence () const
virtual bool hasComputableLoopEvolution (const Loop *QL) const
virtual bool isLoopInvariant (const Loop *QueryLoop) const
virtual const TypegetType () const
bool isAffine () const
bool isQuadratic () const
SCEVHandle evaluateAtIteration (SCEVHandle It) const
SCEVHandle getNumIterationsInRange (ConstantRange Range) const
SCEVHandle replaceSymbolicValuesWithConcrete (const SCEVHandle &Sym, const SCEVHandle &Conc) const
virtual void print (std::ostream &OS) const

Static Public Member Functions

static SCEVHandle get (const SCEVHandle &Start, const SCEVHandle &Step, const Loop *)
static SCEVHandle get (std::vector< SCEVHandle > &Operands, const Loop *)
static SCEVHandle get (const std::vector< SCEVHandle > &Operands, const Loop *L)
static bool classof (const SCEVAddRecExpr *S)
 Methods for support type inquiry through isa, cast, and dyn_cast:.
static bool classof (const SCEV *S)

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 350 of file ScalarEvolutionExpressions.h.


Member Typedef Documentation

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

Definition at line 372 of file ScalarEvolutionExpressions.h.


Member Function Documentation

SCEVHandle SCEVAddRecExpr::get ( const SCEVHandle Start,
const SCEVHandle Step,
const Loop L 
) [static]

SCEVAddRecExpr::get - Get a add recurrence expression for the specified loop. Simplify the expression as much as possible.

Definition at line 1015 of file ScalarEvolution.cpp.

Referenced by get(), llvm::SCEVMulExpr::get(), llvm::SCEVAddExpr::get(), llvm::SCEVTruncateExpr::get(), getNumIterationsInRange(), llvm::SCEVExpander::getOrInsertCanonicalInductionVariable(), getStepRecurrence(), replaceSymbolicValuesWithConcrete(), and llvm::SCEVExpander::visitAddRecExpr().

SCEVHandle SCEVAddRecExpr::get ( std::vector< SCEVHandle > &  Operands,
const Loop L 
) [static]

SCEVAddRecExpr::get - Get a add recurrence expression for the specified loop. Simplify the expression as much as possible.

Definition at line 1032 of file ScalarEvolution.cpp.

References get(), and SCEVAddRecExprs.

static SCEVHandle llvm::SCEVAddRecExpr::get ( const std::vector< SCEVHandle > &  Operands,
const Loop L 
) [inline, static]

Definition at line 366 of file ScalarEvolutionExpressions.h.

References get().

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

Definition at line 373 of file ScalarEvolutionExpressions.h.

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

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

Definition at line 374 of file ScalarEvolutionExpressions.h.

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

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

Definition at line 376 of file ScalarEvolutionExpressions.h.

Referenced by evaluateAtIteration(), llvm::SCEVMulExpr::get(), llvm::SCEVAddExpr::get(), getNumIterationsInRange(), getStepRecurrence(), isAffine(), isQuadratic(), replaceSymbolicValuesWithConcrete(), SolveQuadraticEquation(), and llvm::SCEVExpander::visitAddRecExpr().

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

Definition at line 377 of file ScalarEvolutionExpressions.h.

Referenced by evaluateAtIteration(), llvm::SCEVMulExpr::get(), llvm::SCEVAddExpr::get(), getNumIterationsInRange(), getSCEVStartAndStride(), getStepRecurrence(), isLoopInvariant(), replaceSymbolicValuesWithConcrete(), SolveQuadraticEquation(), and llvm::SCEVExpander::visitAddRecExpr().

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

Definition at line 378 of file ScalarEvolutionExpressions.h.

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

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

Definition at line 379 of file ScalarEvolutionExpressions.h.

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

SCEVHandle llvm::SCEVAddRecExpr::getStepRecurrence (  )  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 385 of file ScalarEvolutionExpressions.h.

References get(), getLoop(), getNumOperands(), getOperand(), op_begin(), and op_end().

virtual bool llvm::SCEVAddRecExpr::hasComputableLoopEvolution ( const Loop QL  )  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 391 of file ScalarEvolutionExpressions.h.

bool SCEVAddRecExpr::isLoopInvariant ( const Loop QueryLoop  )  const [virtual]

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

Implements llvm::SCEV.

Definition at line 351 of file ScalarEvolution.cpp.

References llvm::Loop::contains(), llvm::Loop::getHeader(), and getOperand().

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

getType - Return the LLVM type of this SCEV expression.

Implements llvm::SCEV.

Definition at line 398 of file ScalarEvolutionExpressions.h.

Referenced by 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 402 of file ScalarEvolutionExpressions.h.

References getNumOperands().

Referenced by getNumIterationsInRange(), and getSCEVStartAndStride().

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 411 of file ScalarEvolutionExpressions.h.

References getNumOperands().

Referenced by getNumIterationsInRange().

SCEVHandle SCEVAddRecExpr::evaluateAtIteration ( SCEVHandle  It  )  const

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

Definition at line 537 of file ScalarEvolution.cpp.

References llvm::SCEVAddExpr::get(), llvm::SCEVMulExpr::get(), llvm::SCEVSDivExpr::get(), llvm::SCEVUnknown::getIntegerSCEV(), getNumOperands(), getOperand(), getStart(), PartialFact(), Ty, and Val.

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

SCEVHandle SCEVAddRecExpr::getNumIterationsInRange ( ConstantRange  Range  )  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.

Definition at line 2305 of file ScalarEvolution.cpp.

References A, llvm::ConstantRange::contains(), evaluateAtIteration(), EvaluateConstantChrecAtConstant(), llvm::SCEVUnknown::get(), llvm::SCEVConstant::get(), llvm::ConstantInt::get(), get(), llvm::ConstantExpr::getAdd(), llvm::ConstantExpr::getDiv(), llvm::SCEVUnknown::getIntegerSCEV(), getLoop(), llvm::SCEV::getNegativeSCEV(), getNumOperands(), getOperand(), getStart(), llvm::ConstantExpr::getSub(), llvm::SCEVConstant::getType(), getType(), llvm::ConstantRange::getUpper(), llvm::SCEVConstant::getValue(), isAffine(), llvm::ConstantRange::isFullSet(), isQuadratic(), llvm::Type::isUnsigned(), NumBruteForceEvaluations, op_begin(), op_end(), SolveQuadraticEquation(), llvm::ConstantRange::subtract(), llvm::ConstantBool::True, and Val.

SCEVHandle SCEVAddRecExpr::replaceSymbolicValuesWithConcrete ( const SCEVHandle Sym,
const SCEVHandle Conc 
) 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 330 of file ScalarEvolution.cpp.

References get(), getNumOperands(), getOperand(), and H.

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 359 of file ScalarEvolution.cpp.

References llvm::Loop::getHeader(), and llvm::Value::getName().

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

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

Definition at line 433 of file ScalarEvolutionExpressions.h.

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

Definition at line 434 of file ScalarEvolutionExpressions.h.

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


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