preliminary stall computation working
authorjjenista <jjenista>
Thu, 30 Apr 2009 21:48:29 +0000 (21:48 +0000)
committerjjenista <jjenista>
Thu, 30 Apr 2009 21:48:29 +0000 (21:48 +0000)
Robust/src/Analysis/MLP/MLPAnalysis.java

index c4961b631e18020d71738a9d9d57bce7f2f965c8..0b4c95045166315f78ea66d53993651995f7ffc7 100644 (file)
@@ -525,7 +525,7 @@ public class MLPAnalysis {
   private void computeStalls_nodeActions( FlatNode fn,
                                           VarSrcTokTable vstTable,
                                           FlatSESEEnterNode currentSESE ) {
-    String s = "no op";
+    String s = null;
 
     switch( fn.kind() ) {
 
@@ -538,27 +538,27 @@ public class MLPAnalysis {
     } break;
 
     default: {          
-      Set<VariableSourceToken> stallSet = vstTable.getStallSet( currentSESE );           
-      Set<TempDescriptor>      liveIn   = currentSESE.getInVarSet();
-
-      if( liveIn != null ) {
-       stallSet.retainAll( liveIn );
-      } else {
-       // there is nothing live, clear all
-       stallSet.clear();
+      Set<VariableSourceToken> stallSet = vstTable.getStallSet( currentSESE );
+      TempDescriptor[] readarray=fn.readsTemps();
+      for(int i=0;i<readarray.length;i++) {
+         TempDescriptor readtmp=readarray[i];
+         Set<VariableSourceToken> readSet = vstTable.get(readtmp);
+         //containsAny
+         for(Iterator<VariableSourceToken> readit=readSet.iterator();readit.hasNext();) {
+             VariableSourceToken vst=readit.next();
+             if (stallSet.contains(vst)) {
+                 if (s==null)
+                     s="STALL for:";
+                 s+="("+vst+" "+readtmp+")";
+             }
+         }
+         
       }
-
-      if( !stallSet.isEmpty() ) {
-       s = "STALL for:";
-       Iterator<VariableSourceToken> itr = stallSet.iterator();
-       while( itr.hasNext() ) {
-         VariableSourceToken vst = itr.next();
-         s += "  "+vst.getVarLive()+",";
-       }       
-      }      
     } break;
 
     } // end switch
+    if (s==null)
+       s="no op";
 
     codePlan.put( fn, s );
   }