Mercurial > hg > graal-compiler
diff graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariable.java @ 11263:acf09b065eba
Calculate exit value of counted loop induction variables.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Thu, 08 Aug 2013 11:30:21 +0200 |
parents | 27733a62ba72 |
children | 2c4aa758ee18 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariable.java Tue Aug 06 14:44:36 2013 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/InductionVariable.java Thu Aug 08 11:30:21 2013 +0200 @@ -26,6 +26,9 @@ import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; +/** + * This class describes a value node that is an induction variable in a counted loop. + */ public abstract class InductionVariable { public enum Direction { @@ -55,10 +58,20 @@ public abstract Direction direction(); + /** + * Returns the value node that is described by this InductionVariable instance. + */ public abstract ValueNode valueNode(); + /** + * Returns the node that gives the initial value of this induction variable. + */ public abstract ValueNode initNode(); + /** + * Returns the stride of the induction variable. The stride is the value that is added to the + * induction variable at each iteration. + */ public abstract ValueNode strideNode(); public abstract boolean isConstantInit(); @@ -69,6 +82,10 @@ public abstract long constantStride(); + /** + * Returns the extremum value of the induction variable. The extremum value is the value of the + * induction variable in the loop body of the last iteration. + */ public ValueNode extremumNode() { return extremumNode(false, valueNode().kind()); } @@ -78,4 +95,10 @@ public abstract boolean isConstantExtremum(); public abstract long constantExtremum(); + + /** + * Returns the exit value of the induction variable. The exit value is the value of the + * induction variable at the loop exit. + */ + public abstract ValueNode exitValueNode(); }