variable source tokens have a temp for the live variable name and a temp for the...
authorjjenista <jjenista>
Fri, 17 Apr 2009 21:54:39 +0000 (21:54 +0000)
committerjjenista <jjenista>
Fri, 17 Apr 2009 21:54:39 +0000 (21:54 +0000)
Robust/src/Analysis/MLP/MLPAnalysis.java
Robust/src/Analysis/MLP/VarSrcTokTable.java
Robust/src/Analysis/MLP/VariableSourceToken.java

index e9092d02f9d612a8f9348d84f40319a5ed6020da..b2579f1991dcc8e729e46aeeec70f759a91fe236 100644 (file)
@@ -90,7 +90,6 @@ public class MLPAnalysis {
       livenessAnalysisBackward( fsen );
     }
 
-    /*
     seseItr = seseRoots.iterator();
     while( seseItr.hasNext() ) {
       FlatSESEEnterNode fsen = seseItr.next();
@@ -99,7 +98,6 @@ public class MLPAnalysis {
       // variable analysis for refinement and stalls
       variableAnalysisForward( fsen );
     }
-    */
 
     double timeEndAnalysis = (double) System.nanoTime();
     double dt = (timeEndAnalysis - timeStartAnalysis)/(Math.pow( 10.0, 9.0 ) );
@@ -222,22 +220,10 @@ public class MLPAnalysis {
     Set<FlatNode> flatNodesToVisit = new HashSet<FlatNode>();
     FlatSESEExitNode fsexn = fsen.getFlatExit();
     flatNodesToVisit.add( fsexn );
-    /*
-    for( int i = 0; i < fsexn.numPrev(); i++ ) {
-      FlatNode nn = fsexn.getPrev( i );         
-      flatNodesToVisit.add( nn );       
-    }
-    */
 
     while( !flatNodesToVisit.isEmpty() ) {
       FlatNode fn = (FlatNode) flatNodesToVisit.iterator().next();
       flatNodesToVisit.remove( fn );      
-
-      /*
-      if( fn.kind() == FKind.FlatSESEExitNode ) {
-       fn = ((FlatSESEExitNode)fn).getFlatEnter();
-      }
-      */
       
       Set<TempDescriptor> prev = livenessResults.get( fn );
 
@@ -279,13 +265,6 @@ public class MLPAnalysis {
       while( tItr.hasNext() ) {
        System.out.println( "  "+tItr.next() );
       }
-      /*
-      System.out.println( "and out-set:" );
-      tItr = fsen.getOutVarSet().iterator();
-      while( tItr.hasNext() ) {
-       System.out.println( "  "+tItr.next() );
-      }
-      */
       System.out.println( "" );
     }
   }
index e1a20253403483155227e1c45e8da4212a968d0d..ef13bfaccc00544ab046244f24e1a304bd4d312d 100644 (file)
@@ -15,8 +15,8 @@ public class VarSrcTokTable {
   // true set.  Note that a particular triple from the quick
   // look up must be checked against the true set--remove ops
   // can cause the hashtables to be inconsistent to each other
-  private Hashtable< FlatSESEEnterNode, Set<VariableSourceToken> > sese2vst;
   private Hashtable< TempDescriptor,    Set<VariableSourceToken> >  var2vst;
+  private Hashtable< FlatSESEEnterNode, Set<VariableSourceToken> > sese2vst;
   private Hashtable< SVKey,             Set<VariableSourceToken> >   sv2vst;
 
   // maximum age from aging operation
@@ -44,14 +44,14 @@ public class VarSrcTokTable {
     s.add( vst );
     sese2vst.put( vst.getSESE(), s );
 
-    s = var2vst.get( vst.getVar() );
+    s = var2vst.get( vst.getVarLive() );
     if( s == null ) {
       s = new HashSet<VariableSourceToken>();
     }
     s.add( vst );
-    var2vst.put( vst.getVar(), s );
+    var2vst.put( vst.getVarLive(), s );
 
-    SVKey key = new SVKey( vst.getSESE(), vst.getVar() );
+    SVKey key = new SVKey( vst.getSESE(), vst.getVarLive() );
     s = sv2vst.get( key );
     if( s == null ) {
       s = new HashSet<VariableSourceToken>();
@@ -210,8 +210,9 @@ public class VarSrcTokTable {
   // any child becomes curr with age 0, and any
   // curr tokens increase age by 1
   public VarSrcTokTable age( FlatSESEEnterNode curr ) {
-    VarSrcTokTable out = new VarSrcTokTable();
 
+    VarSrcTokTable out = new VarSrcTokTable();
+    /*
     Iterator<VariableSourceToken> itr = trueSet.iterator();
     while( itr.hasNext() ) {
       VariableSourceToken vst = itr.next();
@@ -221,16 +222,16 @@ public class VarSrcTokTable {
          newAge = MAX_AGE;
        }
         out.add( new VariableSourceToken( curr, 
-                                          vst.getVar(), 
+                                          vst.getVarLive(), 
                                          newAge ) );
       } else {
         assert curr.getChildren().contains( vst.getSESE() );
         out.add( new VariableSourceToken( curr, 
-                                          vst.getVar(), 
+                                          vst.getVarLive(), 
                                           new Integer( 1 ) ) );
       }
     }
-
+    */
     return out;
   }
 
index 251a31e9a9e980b407672c18c2d3edb4f86da583..b2f02a5b94b543e65bc81a464d8be942fe868007 100644 (file)
@@ -7,30 +7,37 @@ import java.io.*;
 
 public class VariableSourceToken {
 
-  private FlatSESEEnterNode sese;
-  private TempDescriptor    var;
-  private Integer           age;
+  private TempDescriptor    varLive;
+  private FlatSESEEnterNode seseSrc;
+  private Integer           seseAge;
+  private TempDescriptor    varSrc; 
 
-  public VariableSourceToken( FlatSESEEnterNode sese,
-                             TempDescriptor    var, 
-                             Integer           age ) {
-    this.sese = sese;
-    this.var  = var;
-    this.age  = age;
+  public VariableSourceToken( TempDescriptor    varLive, 
+                              FlatSESEEnterNode seseSrc,                             
+                             Integer           seseAge, 
+                              TempDescriptor    varSrc 
+                              ) {
+    this.varLive = varLive;
+    this.seseSrc = seseSrc;
+    this.seseAge = seseAge;
+    this.varSrc  = varSrc; 
   }
 
-  public FlatSESEEnterNode getSESE() {
-    return sese;
+  public TempDescriptor getVarLive() {
+    return varLive;
   }
 
-  public TempDescriptor getVar() {
-    return var;
+  public FlatSESEEnterNode getSESE() {
+    return seseSrc;
   }
 
   public Integer getAge() {
-    return age;
+    return seseAge;
   }
 
+  public TempDescriptor getVarSrc() {
+    return varSrc;
+  }
 
   public boolean equals( Object o ) {
     if( o == null ) {
@@ -43,17 +50,18 @@ public class VariableSourceToken {
 
     VariableSourceToken vst = (VariableSourceToken) o;
 
-    return sese.equals( vst.sese ) &&
-            var.equals( vst.var  ) &&
-            age.equals( vst.age  );
+    return seseSrc.equals( vst.seseSrc ) &&
+            varSrc.equals( vst.varSrc  ) &&
+           seseAge.equals( vst.seseAge ) &&
+           varLive.equals( vst.varLive );
   }
 
   public int hashCode() {
-    return (sese.hashCode() << 3) * (var.hashCode() << 2) ^ age.intValue();
+    return (seseSrc.hashCode() << 3) + (varSrc.hashCode() << 4) * (varLive.hashCode() << 2) ^ seseAge.intValue();
   }
 
 
   public String toString() {
-    return "["+sese.getPrettyIdentifier()+", "+var+", "+age+"]";
+    return "["+varLive+" -> "+seseSrc.getPrettyIdentifier()+", "+seseAge+", "+varSrc+"]";
   }
 }