From 2ea5896d5534e96292c31465a74059f02eba7d34 Mon Sep 17 00:00:00 2001 From: jjenista Date: Mon, 3 Aug 2009 18:10:02 +0000 Subject: [PATCH] primitives passed to a child and then all available stuff copied back at one stall, successfully --- Robust/src/Analysis/MLP/MLPAnalysis.java | 34 +++++---------------- Robust/src/Analysis/MLP/VarSrcTokTable.java | 6 ++-- Robust/src/IR/Flat/BuildCode.java | 7 +++-- 3 files changed, 15 insertions(+), 32 deletions(-) diff --git a/Robust/src/Analysis/MLP/MLPAnalysis.java b/Robust/src/Analysis/MLP/MLPAnalysis.java index 036ccc5d..752de79a 100644 --- a/Robust/src/Analysis/MLP/MLPAnalysis.java +++ b/Robust/src/Analysis/MLP/MLPAnalysis.java @@ -144,8 +144,8 @@ public class MLPAnalysis { System.out.println( "" ); //System.out.println( "\nSESE Hierarchy\n--------------\n" ); printSESEHierarchy(); //System.out.println( "\nSESE Liveness\n-------------\n" ); printSESELiveness(); - //System.out.println( "\nLiveness Root View\n------------------\n"+fmMain.printMethod( livenessRootView ) ); - //System.out.println( "\nVariable Results\n----------------\n"+fmMain.printMethod( variableResults ) ); + System.out.println( "\nLiveness Root View\n------------------\n"+fmMain.printMethod( livenessRootView ) ); + System.out.println( "\nVariable Results\n----------------\n"+fmMain.printMethod( variableResults ) ); //System.out.println( "\nNot Available Results\n---------------------\n"+fmMain.printMethod( notAvailableResults ) ); System.out.println( "\nCode Plans\n----------\n"+fmMain.printMethod( codePlans ) ); } @@ -842,29 +842,11 @@ public class MLPAnalysis { Iterator availItr = vstTable.get( vst.getSESE(), vst.getAge() ).iterator(); - /* - System.out.println( "Considering a stall on "+vst+ - " and also getting\n "+vstTable.get( vst.getSESE(), - vst.getAge() - ) );*/ - - // only grab additional stuff that is live - Set copySet = new HashSet(); - - //System.out.println( "*** live in = "+liveSet+" @node "+fn ); - while( availItr.hasNext() ) { VariableSourceToken vstAlsoAvail = availItr.next(); - /* - Iterator refVarItr = - vstAlsoAvail.getRefVars().iterator(); - - - if( liveSet.contains( vstAlsoAvail.getAddrVar() ) ) { - copySet.add( vstAlsoAvail.getAddrVar() ); - } - */ + // only grab additional stuff that is live + Set copySet = new HashSet(); Iterator refVarItr = vstAlsoAvail.getRefVars().iterator(); while( refVarItr.hasNext() ) { @@ -874,10 +856,10 @@ public class MLPAnalysis { } } - //System.out.println( vstAlsoAvail+" is available, copySet = "+copySet ); - } - - plan.addStall2CopySet( vst, copySet ); + if( !copySet.isEmpty() ) { + plan.addStall2CopySet( vstAlsoAvail, copySet ); + } + } } // assert that everything being stalled for is in the diff --git a/Robust/src/Analysis/MLP/VarSrcTokTable.java b/Robust/src/Analysis/MLP/VarSrcTokTable.java index 7e16c100..0f118c74 100644 --- a/Robust/src/Analysis/MLP/VarSrcTokTable.java +++ b/Robust/src/Analysis/MLP/VarSrcTokTable.java @@ -134,11 +134,11 @@ public class VarSrcTokTable { return s; } - public Set get( TempDescriptor var ) { - Set s = var2vst.get( var ); + public Set get( TempDescriptor refVar ) { + Set s = var2vst.get( refVar ); if( s == null ) { s = new HashSet(); - var2vst.put( var, s ); + var2vst.put( refVar, s ); } return s; } diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 61dcf0b3..1efb476a 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -2227,10 +2227,11 @@ public class BuildCode { Iterator tdItr = cp.getCopySet( vst ).iterator(); while( tdItr.hasNext() ) { TempDescriptor td = tdItr.next(); + output.println(" "+td.getSafeSymbol()+" = child->"+ vst.getAddrVar().getSafeSymbol()+";"); - output.println("printf(\"copied %d into "+td.getSafeSymbol()+" from "+vst.getAddrVar().getSafeSymbol()+ - "\\n\", "+td.getSafeSymbol()+" );"); + //output.println("printf(\"copied %d into "+td.getSafeSymbol()+" from "+vst.getAddrVar().getSafeSymbol()+ + //"\\n\", "+td.getSafeSymbol()+" );"); } output.println(" }"); @@ -2746,7 +2747,7 @@ public class BuildCode { output.println(" "+paramsprefix+"->"+temp.getSafeSymbol()+" = "+temp.getSafeSymbol()+";" ); - output.println(" printf(\" putting "+temp.getSafeSymbol()+" in out with val=%d\\n\", "+temp.getSafeSymbol()+");"); + //output.println(" printf(\" putting "+temp.getSafeSymbol()+" in out with val=%d\\n\", "+temp.getSafeSymbol()+");"); } // if parent is stalling on you, let them know you're done -- 2.34.1