From: jjenista Date: Thu, 23 Apr 2009 18:41:44 +0000 (+0000) Subject: quick capture X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=910bdb157455a0d446a24afc6b0eb89e69b34109;p=IRC.git quick capture --- diff --git a/Robust/src/Analysis/MLP/MLPAnalysis.java b/Robust/src/Analysis/MLP/MLPAnalysis.java index d47ec3f8..b9f07420 100644 --- a/Robust/src/Analysis/MLP/MLPAnalysis.java +++ b/Robust/src/Analysis/MLP/MLPAnalysis.java @@ -24,6 +24,7 @@ public class MLPAnalysis { private Hashtable< FlatNode, Stack > seseStacks; private Hashtable< FlatNode, Set > livenessResults; private Hashtable< FlatNode, VarSrcTokTable > variableResults; + private Hashtable< FlatNode, String > codePlan; public MLPAnalysis( State state, @@ -43,6 +44,8 @@ public class MLPAnalysis { seseStacks = new Hashtable< FlatNode, Stack >(); livenessResults = new Hashtable< FlatNode, Set >(); 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" ); @@ -57,23 +60,12 @@ public class MLPAnalysis { // reachability analysis already computed this so reuse Iterator 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(); - } } @@ -84,15 +76,8 @@ public class MLPAnalysis { // 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 @@ -103,8 +88,7 @@ public class MLPAnalysis { // 4th pass methItr = ownAnalysis.descriptorsToAnalyze.iterator(); while( methItr.hasNext() ) { - Descriptor d = methItr.next(); - + Descriptor d = methItr.next(); FlatMethod fm = state.getMethodFlat( d ); computeStallsForward( fm ); @@ -117,6 +101,7 @@ public class MLPAnalysis { System.out.println( treport ); } + private void buildForestForward( FlatMethod fm ) { // start from flat method top, visit every node in @@ -154,6 +139,10 @@ public class MLPAnalysis { } } } + + if( state.MLPDEBUG ) { + printSESEForest(); + } } private void buildForest_nodeActions( FlatNode fn, @@ -327,9 +316,6 @@ public class MLPAnalysis { flatNodesToVisit.add( nn ); } } - } - - if( state.MLPDEBUG ) { } } @@ -434,6 +420,10 @@ public class MLPAnalysis { } } } + + if( state.MLPDEBUG ) { + fm.printMethod( codePlan ); + } } private void computeStalls_nodeActions( FlatNode fn, @@ -450,10 +440,21 @@ public class MLPAnalysis { } break; default: { - Set stallSet = - vstTable.getStallSet( currentSESE ); + String s = "no op"; + + Set stallSet = vstTable.getStallSet( currentSESE ); + if( !stallSet.isEmpty() ) { + + s = "stall for:"; + + Iterator 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 diff --git a/Robust/src/Analysis/MLP/VariableSourceToken.java b/Robust/src/Analysis/MLP/VariableSourceToken.java index b2f02a5b..26a18aae 100644 --- a/Robust/src/Analysis/MLP/VariableSourceToken.java +++ b/Robust/src/Analysis/MLP/VariableSourceToken.java @@ -62,6 +62,6 @@ public class VariableSourceToken { public String toString() { - return "["+varLive+" -> "+seseSrc.getPrettyIdentifier()+", "+seseAge+", "+varSrc+"]"; + return varLive+" from "+varSrc+" in "+seseSrc.getPrettyIdentifier()+"("+seseAge+")"; } }