|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.score.InductionVar
public final class InductionVar
Record information about a loop induction variable.
$Id: InductionVar.java,v 1.42 2007-10-04 19:58:18 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
The loop induction variable is the variable that is modified on each iteration of the loop and controls whether the loop terminates. For example, in
for (i = init; i < n; i += step) { }The variable
i
is the induction variable. The
expression init
is the initialization expression,
i < n
is the termination expression, and i +
step
is the induction expression.
Constructor Summary | |
---|---|
InductionVar(LoopHeaderChord loop,
VariableDecl var)
|
Method Summary | |
---|---|
void |
clean()
Unlink any expression referenced by theis induction variable instance. |
Expr |
getEndExpr()
Return the end value of the induction variable or null if it is not known. |
AffineExpr |
getForwardExpr()
Return the induction variable's forward affine expression. |
Expr |
getInitExpr()
Return the expression that specifies the initial value of the induction variable. |
long |
getIterationCount()
Return the number of times the induction variable will be iterated or -1 if not known. |
LoopHeaderChord |
getLoopHeader()
Return the loop associ8ated with this induction variable. |
java.lang.String |
getName()
Return the name of the induction variable. |
Expr |
getStepExpr()
Return the step expression for the induction variable. |
long |
getStepValue()
Return the induction step value or zero if it is not known or not a constant value. |
Expr |
getTermExpr()
Return the expression that terminates the loop. |
VariableDecl |
getVar()
Return a reference to the induction variable. |
boolean |
hasForward()
Return true if this induction variable has a forward affine expression. |
boolean |
isPrimary()
Return true if this is the primary induction variable for the loop. |
void |
markForward()
Specify that this induction variable has a forward affine expression. |
void |
markPrimary()
Specify that this induction variable is the primary induction variable for the loop. |
boolean |
moreCompleteThan(InductionVar ivar)
Return true if this induction variable is better than the specified induction variable. |
void |
setForwardExpr(AffineExpr ae)
Specify the induction variable's forward affine expression. |
void |
setInitExpr(Expr init)
Set the expression that specifies the initial value of the induction variable. |
void |
setStepExpr(Expr step)
Set the induction step value or zero if it is not known. |
void |
setTermExpr(MatchExpr term,
boolean reverse)
Set the expression that terminates the loop. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InductionVar(LoopHeaderChord loop, VariableDecl var)
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public LoopHeaderChord getLoopHeader()
public VariableDecl getVar()
public Expr getTermExpr()
public void setTermExpr(MatchExpr term, boolean reverse)
term
- is the test expressionreverse
- is true if the test is reversed for the exit from the looppublic Expr getInitExpr()
public void setInitExpr(Expr init)
public Expr getEndExpr()
null
if it is not known. Note: this is not
necessarily the value the induction variable will have after the
loop terminates. Rather, it is the last value the induction
variable will have inside the loop.
public long getIterationCount()
public long getStepValue()
public void setStepExpr(Expr step)
public Expr getStepExpr()
null
. It is guaranteed to be
loop invariant. Note - the epression returned does not have any
use-def links.
public boolean isPrimary()
public void markPrimary()
public boolean hasForward()
public void markForward()
public AffineExpr getForwardExpr()
public void setForwardExpr(AffineExpr ae)
public java.lang.String getName()
public boolean moreCompleteThan(InductionVar ivar)
public void clean()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |