|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.EmptyAttributeVisitor
at.dms.kjc.ReplacingVisitor
at.dms.kjc.SLIRReplacingVisitor
at.dms.kjc.rstream.IDDoLoops
public class IDDoLoops
This pass identifies java-style for loops that can be converted to fortran-style do loops. It should be run right before code generation so that no other pass alters the for loops that are recognized and thus invalidates the classification.
Field Summary |
---|
Fields inherited from class at.dms.kjc.EmptyAttributeVisitor |
---|
forwards |
Fields inherited from interface at.dms.kjc.Constants |
---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
Method Summary | |
---|---|
static void |
doit(FlatNode top)
The entry point of this class, given a stream *top* and everything downstream of it, classify the for loop in each method of each filter as to whether they can be converted to do loops. |
static void |
doit(SIRFilter filter)
|
static JExpression |
getExpression(JStatement orig)
Given a statement, return the expression that this statement is composed of, if not an expression statement return null. |
boolean |
scopeOfInduction(JForStatement jfor,
at.dms.kjc.rstream.DoLoopInformation doInfo)
Check to see that the scope of the induction var is limited to the for loop, i.e. |
Object |
visitForStatement(JForStatement self,
JStatement init,
JExpression cond,
JStatement incr,
JStatement body)
See comments in method. |
void |
visitNode(FlatNode node)
Visit a flat node and iterate over all the methods if this is a filter flat node and check for do loops. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void doit(FlatNode top)
top
- The top level of the applicationpublic static void doit(SIRFilter filter)
public void visitNode(FlatNode node)
visitNode
in interface FlatVisitor
node
- current flat node we are visitingpublic Object visitForStatement(JForStatement self, JStatement init, JExpression cond, JStatement incr, JStatement body)
visitForStatement
in interface AttributeVisitor<Object>
visitForStatement
in class ReplacingVisitor
public boolean scopeOfInduction(JForStatement jfor, at.dms.kjc.rstream.DoLoopInformation doInfo)
jfor
- The for statementdoInfo
- The do loop information, used for to get induction variable
public static JExpression getExpression(JStatement orig)
orig
- The statement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |