private Hashtable< FlatNode, Stack<FlatSESEEnterNode> > seseStacks;
private Hashtable< FlatNode, Set<TempDescriptor> > livenessResults;
private Hashtable< FlatNode, VarSrcTokTable > variableResults;
+ private Hashtable< FlatNode, String > codePlan;
public MLPAnalysis( State state,
seseStacks = new Hashtable< FlatNode, Stack<FlatSESEEnterNode> >();
livenessResults = new Hashtable< FlatNode, Set<TempDescriptor> >();
variableResults = new Hashtable< FlatNode, VarSrcTokTable >();
+ codePlan = new Hashtable< FlatNode, String >();
+
// build an implicit root SESE to wrap contents of main method
rootTree = new SESENode( "root" );
// reachability analysis already computed this so reuse
Iterator<Descriptor> methItr = ownAnalysis.descriptorsToAnalyze.iterator();
while( methItr.hasNext() ) {
- Descriptor d = methItr.next();
-
- FlatMethod fm;
- if( d instanceof MethodDescriptor ) {
- fm = state.getMethodFlat( (MethodDescriptor) d);
- } else {
- assert d instanceof TaskDescriptor;
- fm = state.getMethodFlat( (TaskDescriptor) d);
- }
+ Descriptor d = methItr.next();
+ FlatMethod fm = state.getMethodFlat( d );
// find every SESE from methods that may be called
// and organize them into roots and children
buildForestForward( fm );
-
- if( state.MLPDEBUG ) {
- printSESEForest();
- }
}
// 3rd pass
methItr = ownAnalysis.descriptorsToAnalyze.iterator();
while( methItr.hasNext() ) {
- Descriptor d = methItr.next();
-
- FlatMethod fm;
- if( d instanceof MethodDescriptor ) {
- fm = state.getMethodFlat( (MethodDescriptor) d);
- } else {
- assert d instanceof TaskDescriptor;
- fm = state.getMethodFlat( (TaskDescriptor) d);
- }
+ Descriptor d = methItr.next();
+ FlatMethod fm = state.getMethodFlat( d );
// starting from roots do a forward, fixed-point
// variable analysis for refinement and stalls
// 4th pass
methItr = ownAnalysis.descriptorsToAnalyze.iterator();
while( methItr.hasNext() ) {
- Descriptor d = methItr.next();
-
+ Descriptor d = methItr.next();
FlatMethod fm = state.getMethodFlat( d );
computeStallsForward( fm );
System.out.println( treport );
}
+
private void buildForestForward( FlatMethod fm ) {
// start from flat method top, visit every node in
}
}
}
+
+ if( state.MLPDEBUG ) {
+ printSESEForest();
+ }
}
private void buildForest_nodeActions( FlatNode fn,
flatNodesToVisit.add( nn );
}
}
- }
-
- if( state.MLPDEBUG ) {
}
}
}
}
}
+
+ if( state.MLPDEBUG ) {
+ fm.printMethod( codePlan );
+ }
}
private void computeStalls_nodeActions( FlatNode fn,
} break;
default: {
- Set<VariableSourceToken> stallSet =
- vstTable.getStallSet( currentSESE );
+ String s = "no op";
+
+ Set<VariableSourceToken> stallSet = vstTable.getStallSet( currentSESE );
+ if( !stallSet.isEmpty() ) {
+
+ s = "stall for:";
+
+ Iterator<VariableSourceToken> itr = stallSet.iterator();
+ while( itr.hasNext() ) {
+ VariableSourceToken vst = itr.next();
+ s += " "+vst;
+ }
+ }
- System.out.println( fn+" should stall on\n "+stallSet+"\n" );
+ codePlan.put( fn, s );
} break;
} // end switch