LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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


Member Typedef Documentation

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

Definition at line 329 of file ScalarEvolutionExpressions.h.


Member Function Documentation

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

Definition at line 391 of file ScalarEvolutionExpressions.h.

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

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

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

Definition at line 390 of file ScalarEvolutionExpressions.h.

SCEVHandle SCEVAddRecExpr::evaluateAtIteration SCEVHandle  It  )  const
 

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

Definition at line 497 of file ScalarEvolution.cpp.

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

Referenced by EvaluateConstantChrecAtConstant(), and getNumIterationsInRange().

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

Definition at line 323 of file ScalarEvolutionExpressions.h.

References get().

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

References get().

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

Referenced by get(), llvm::SCEVMulExpr::get(), llvm::SCEVAddExpr::get(), llvm::SCEVTruncateExpr::get(), getNumIterationsInRange(), and getStepRecurrence().

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

Definition at line 336 of file ScalarEvolutionExpressions.h.

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

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

References 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(), 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(), and llvm::ConstantBool::True.

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

Definition at line 333 of file ScalarEvolutionExpressions.h.

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

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

Definition at line 334 of file ScalarEvolutionExpressions.h.

Referenced by evaluateAtIteration(), llvm::SCEVMulExpr::get(), llvm::SCEVAddExpr::get(), getNumIterationsInRange(), getStepRecurrence(), and SolveQuadraticEquation().

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

Definition at line 335 of file ScalarEvolutionExpressions.h.

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

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

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

Referenced by llvm::SCEVMulExpr::get().

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

getType - Return the LLVM type of this SCEV expression.

Implements llvm::SCEV.

Definition at line 357 of file ScalarEvolutionExpressions.h.

Referenced by getNumIterationsInRange().

virtual bool llvm::SCEVAddRecExpr::hasComputableLoopEvolution const Loop QL  )  const [inline, virtual]
 

FIXME: What if the start or step value a recurrence for the specified loop?

Implements llvm::SCEV.

Definition at line 348 of file ScalarEvolutionExpressions.h.

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

References getNumOperands().

Referenced by getNumIterationsInRange().

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

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

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

References getNumOperands().

Referenced by getNumIterationsInRange().

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

Definition at line 330 of file ScalarEvolutionExpressions.h.

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

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

Definition at line 331 of file ScalarEvolutionExpressions.h.

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

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

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


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