From: jjenista Date: Fri, 17 Apr 2009 21:54:39 +0000 (+0000) Subject: variable source tokens have a temp for the live variable name and a temp for the... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=25311b53fb5cb59213b74a6f0f8f9126e814fdcf;p=IRC.git variable source tokens have a temp for the live variable name and a temp for the source variable --- diff --git a/Robust/src/Analysis/MLP/MLPAnalysis.java b/Robust/src/Analysis/MLP/MLPAnalysis.java index e9092d02..b2579f19 100644 --- a/Robust/src/Analysis/MLP/MLPAnalysis.java +++ b/Robust/src/Analysis/MLP/MLPAnalysis.java @@ -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 flatNodesToVisit = new HashSet(); 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 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( "" ); } } diff --git a/Robust/src/Analysis/MLP/VarSrcTokTable.java b/Robust/src/Analysis/MLP/VarSrcTokTable.java index e1a20253..ef13bfac 100644 --- a/Robust/src/Analysis/MLP/VarSrcTokTable.java +++ b/Robust/src/Analysis/MLP/VarSrcTokTable.java @@ -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 > sese2vst; private Hashtable< TempDescriptor, Set > var2vst; + private Hashtable< FlatSESEEnterNode, Set > sese2vst; private Hashtable< SVKey, Set > 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(); } 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(); @@ -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 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; } diff --git a/Robust/src/Analysis/MLP/VariableSourceToken.java b/Robust/src/Analysis/MLP/VariableSourceToken.java index 251a31e9..b2f02a5b 100644 --- a/Robust/src/Analysis/MLP/VariableSourceToken.java +++ b/Robust/src/Analysis/MLP/VariableSourceToken.java @@ -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+"]"; } }