livenessAnalysisBackward( fsen );
}
- /*
seseItr = seseRoots.iterator();
while( seseItr.hasNext() ) {
FlatSESEEnterNode fsen = seseItr.next();
// variable analysis for refinement and stalls
variableAnalysisForward( fsen );
}
- */
double timeEndAnalysis = (double) System.nanoTime();
double dt = (timeEndAnalysis - timeStartAnalysis)/(Math.pow( 10.0, 9.0 ) );
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 );
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( "" );
}
}
// 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
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>();
// 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();
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;
}
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 ) {
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+"]";
}
}