FlatSESEEnterNode fsen = fsexn.getFlatEnter();
assert currentSESE.getChildren().contains( fsen );
+ // remap all of this child's children tokens to be
+ // from this child as the child exits
vstTable.remapChildTokens( fsen );
// liveness virtual reads are things that might be
// get other things from this source as well
VarSrcTokTable vstTable = variableResults.get( fn );
+ VSTWrapper vstIfStatic = new VSTWrapper();
Integer srcType =
vstTable.getRefVarSrcType( rTemp,
currentSESE,
- currentSESE.getParent() );
+ vstIfStatic
+ );
if( srcType.equals( VarSrcTokTable.SrcType_STATIC ) ) {
- VariableSourceToken vst = vstTable.get( rTemp ).iterator().next();
+ VariableSourceToken vst = vstIfStatic.vst;
Iterator<VariableSourceToken> availItr = vstTable.get( vst.getSESE(),
vst.getAge()
// if a variable is available from the same source, AND it ALSO
// only comes from one statically known source, mark it available
+ VSTWrapper vstIfStaticNotUsed = new VSTWrapper();
Integer srcTypeAlso =
vstTable.getRefVarSrcType( refVarAlso,
currentSESE,
- currentSESE.getParent() );
+ vstIfStaticNotUsed
+ );
if( srcTypeAlso.equals( VarSrcTokTable.SrcType_STATIC ) ) {
notAvailSet.remove( refVarAlso );
}
case FKind.FlatSESEEnterNode: {
FlatSESEEnterNode fsen = (FlatSESEEnterNode) fn;
+ assert fsen.equals( currentSESE );
// track the source types of the in-var set so generated
// code at this SESE issue can compute the number of
Iterator<TempDescriptor> inVarItr = fsen.getInVarSet().iterator();
while( inVarItr.hasNext() ) {
TempDescriptor inVar = inVarItr.next();
+
+ // when we get to an SESE enter node we change the
+ // currentSESE variable of this analysis to the
+ // child that is declared by the enter node, so
+ // in order to classify in-vars correctly, pass
+ // the parent SESE in--at other FlatNode types just
+ // use the currentSESE
+ VSTWrapper vstIfStatic = new VSTWrapper();
Integer srcType =
- vstTableIn.getRefVarSrcType( inVar,
- fsen,
- fsen.getParent() );
+ vstTableIn.getRefVarSrcType( inVar,
+ fsen.getParent(),
+ vstIfStatic
+ );
// the current SESE needs a local space to track the dynamic
// variable and the child needs space in its SESE record
} else if( srcType.equals( VarSrcTokTable.SrcType_STATIC ) ) {
fsen.addStaticInVar( inVar );
- VariableSourceToken vst = vstTableIn.get( inVar ).iterator().next();
+ VariableSourceToken vst = vstIfStatic.vst;
fsen.putStaticInVar2src( inVar, vst );
fsen.addStaticInVarSrc( new SESEandAgePair( vst.getSESE(),
vst.getAge()
)
);
-
} else {
assert srcType.equals( VarSrcTokTable.SrcType_READY );
fsen.addReadyInVar( inVar );
// source and delay until we need to use value
// ask whether lhs and rhs sources are dynamic, static, etc.
+ VSTWrapper vstIfStatic = new VSTWrapper();
Integer lhsSrcType
= vstTableIn.getRefVarSrcType( lhs,
currentSESE,
- currentSESE.getParent() );
-
+ vstIfStatic
+ );
Integer rhsSrcType
= vstTableIn.getRefVarSrcType( rhs,
currentSESE,
- currentSESE.getParent() );
+ vstIfStatic
+ );
if( rhsSrcType.equals( VarSrcTokTable.SrcType_DYNAMIC ) ) {
// if rhs is dynamic going in, lhs will definitely be dynamic
}
// check the source type of this variable
+ VSTWrapper vstIfStatic = new VSTWrapper();
Integer srcType
= vstTableIn.getRefVarSrcType( readtmp,
currentSESE,
- currentSESE.getParent() );
+ vstIfStatic
+ );
if( srcType.equals( VarSrcTokTable.SrcType_DYNAMIC ) ) {
// 1) It is not clear statically where this variable will
- // come from statically, so dynamically we must keep track
+ // come from, so dynamically we must keep track
// along various control paths, and therefore when we stall,
// just stall for the exact thing we need and move on
plan.addDynamicStall( readtmp );
// all live variables with same token/age pair at the same
// time. This is the same stuff that the notavaialable analysis
// marks as now available.
-
- VariableSourceToken vst = vstTableIn.get( readtmp ).iterator().next();
+ VariableSourceToken vst = vstIfStatic.vst;
Iterator<VariableSourceToken> availItr =
vstTableIn.get( vst.getSESE(), vst.getAge() ).iterator();
// completely outside of the root SESE scope
if( nextVstTable != null && nextLiveIn != null ) {
- Hashtable<TempDescriptor, VariableSourceToken> readyOrStatic2dynamicSet =
+ Hashtable<TempDescriptor, VSTWrapper> readyOrStatic2dynamicSet =
thisVstTable.getReadyOrStatic2DynamicSet( nextVstTable,
nextLiveIn,
- currentSESE,
- currentSESE.getParent()
- );
+ currentSESE
+ );
if( !readyOrStatic2dynamicSet.isEmpty() ) {
--- /dev/null
+package Analysis.MLP;
+
+import IR.*;
+import IR.Flat.*;
+import java.util.*;
+import java.io.*;
+
+// the reason for this class is to allow a VariableSourceToken
+// to be null in some circumstances
+
+public class VSTWrapper {
+ public VariableSourceToken vst;
+
+ public VSTWrapper() {
+ vst = null;
+ }
+}
}
- // get a sufficient set of VariableSourceTokens to cover all static sources
- public Set<VariableSourceToken> getStaticSet( FlatSESEEnterNode current,
- FlatSESEEnterNode parent
- ) {
-
- Set<VariableSourceToken> out = new HashSet<VariableSourceToken>();
-
- Iterator itr = var2vst.entrySet().iterator();
- while( itr.hasNext() ) {
- Map.Entry me = (Map.Entry) itr.next();
- TempDescriptor var = (TempDescriptor) me.getKey();
- HashSet<VariableSourceToken> s1 = (HashSet<VariableSourceToken>) me.getValue();
-
- if( getRefVarSrcType( var, current, parent ) == SrcType_STATIC ) {
- out.add( s1.iterator().next() );
- }
- }
-
- return out;
- }
-
-
// given a table from a subsequent program point, decide
- // which variables are going from a static source to a
+ // which variables are going from a non-dynamic to a
// dynamic source and return them
- public Hashtable<TempDescriptor, VariableSourceToken>
+ public Hashtable<TempDescriptor, VSTWrapper>
getReadyOrStatic2DynamicSet( VarSrcTokTable nextTable,
Set<TempDescriptor> nextLiveIn,
- FlatSESEEnterNode current,
- FlatSESEEnterNode parent
+ FlatSESEEnterNode current
) {
- Hashtable<TempDescriptor, VariableSourceToken> out =
- new Hashtable<TempDescriptor, VariableSourceToken>();
+ Hashtable<TempDescriptor, VSTWrapper> out =
+ new Hashtable<TempDescriptor, VSTWrapper>();
Iterator itr = var2vst.entrySet().iterator();
while( itr.hasNext() ) {
// only worth tracking if live
if( nextLiveIn.contains( var ) ) {
+
+ VSTWrapper vstIfStaticBefore = new VSTWrapper();
+ VSTWrapper vstIfStaticAfter = new VSTWrapper();
+
+ Integer srcTypeBefore = this.getRefVarSrcType( var, current, vstIfStaticBefore );
+ Integer srcTypeAfter = nextTable.getRefVarSrcType( var, current, vstIfStaticAfter );
- if( ( this.getRefVarSrcType( var, current, parent ) == SrcType_READY ||
- this.getRefVarSrcType( var, current, parent ) == SrcType_STATIC )
- &&
- nextTable.getRefVarSrcType( var, current, parent ) == SrcType_DYNAMIC
- ) {
- // remember the variable and a static source
+ if( !srcTypeBefore.equals( SrcType_DYNAMIC ) &&
+ srcTypeAfter.equals( SrcType_DYNAMIC )
+ ) {
+ // remember the variable and a source
// it had before crossing the transition
- out.put( var, s1.iterator().next() );
+ // 1) if it was ready, vstIfStatic.vst is null
+ // 2) if is was static, use vstIfStatic.vst
+ out.put( var, vstIfStaticBefore );
}
}
}
// for some reference variable, return the type of source
// it might have in this table, which might be:
- // 1. Ready -- this variable comes from your parent and is
+ // 1. Ready -- this variable is
// definitely available when you are issued.
- // 2. Static -- there is definitely one SESE that will
- // produce the value for this variable
+ // 2. Static -- there is definitely one child SESE with
+ // a known age that will produce the value
// 3. Dynamic -- we don't know where the value will come
- // from, so we'll track it dynamically
+ // from statically, so we'll track it dynamically
public Integer getRefVarSrcType( TempDescriptor refVar,
FlatSESEEnterNode current,
- FlatSESEEnterNode parent ) {
- assert refVar != null;
-
- // if you have no parent (root) and the variable in
- // question is in your in-set, it's a command line
- // argument and it is definitely available
- if( parent == null &&
- current.getInVarSet().contains( refVar ) ) {
+ VSTWrapper vstIfStatic ) {
+ assert refVar != null;
+ assert vstIfStatic != null;
+
+ vstIfStatic.vst = null;
+
+ // when the current SESE is null, that simply means it is
+ // an unknown placeholder, in which case the system will
+ // ensure that any variables are READY
+ if( current == null ) {
return SrcType_READY;
}
// if there appear to be no sources, it means this variable
// comes from outside of any statically-known SESE scope,
- // which means the system guarantees its READY
- Set<VariableSourceToken> srcs = get( refVar );
- if( srcs.isEmpty() ) {
- return SrcType_READY;
- }
+ // which means the system guarantees its READY, so jump over
+ // while loop
+ Set<VariableSourceToken> srcs = get( refVar );
+ Iterator<VariableSourceToken> itrSrcs = srcs.iterator();
+ while( itrSrcs.hasNext() ) {
+ VariableSourceToken vst = itrSrcs.next();
+
+ // to make the refVar non-READY we have to find at least
+ // one child token
+ if( current.getChildren().contains( vst.getSESE() ) ) {
+
+ // if we ever have at least one child source with an
+ // unknown age, have to treat var as dynamic
+ if( vst.getAge().equals( MLPAnalysis.maxSESEage ) ) {
+ return SrcType_DYNAMIC;
+ }
- // if the variable may have more than one source it might be
- // dynamic, unless all sources are from a placeholder
- if( srcs.size() > 1 ) {
- Iterator<VariableSourceToken> itrSrcs = srcs.iterator();
- VariableSourceToken oneSrc = itrSrcs.next();
- while( itrSrcs.hasNext() ) {
- VariableSourceToken anotherSrc = itrSrcs.next();
- if( !oneSrc.getSESE().equals( anotherSrc.getSESE() ) ||
- !oneSrc.getAge( ).equals( anotherSrc.getAge( ) )
- ) {
- return SrcType_DYNAMIC;
- }
- }
-
- // all sources were same SESE and age, BUT, make sure it's
- // not a placeholder SESE, who's vars are always ready
- if( oneSrc.getSESE().getIsCallerSESEplaceholder() ) {
- return SrcType_READY;
+ // if we have a known-age child source, this var is
+ // either static or dynamic now: it's static if this
+ // source is the only source, otherwise dynamic
+ if( srcs.size() > 1 ) {
+ return SrcType_DYNAMIC;
+ }
+
+ vstIfStatic.vst = vst;
+ return SrcType_STATIC;
}
-
- return SrcType_DYNAMIC;
- }
-
- VariableSourceToken singleSrc = srcs.iterator().next();
- // if the one source is max age, track it dynamically
- if( singleSrc.getAge() == MLPAnalysis.maxSESEage ) {
- return SrcType_DYNAMIC;
- }
-
- // if it has one source that comes from the parent, it's ready
- if( singleSrc.getSESE() == parent ) {
- return SrcType_READY;
- }
-
- // if the one source is a placeholder SESE then it's ready
- if( singleSrc.getSESE().getIsCallerSESEplaceholder() ) {
- return SrcType_READY;
}
- // otherwise it comes from one source not the parent (sibling)
- // and we know exactly which static SESE/age it will come from
- return SrcType_STATIC;
+ // if we never found a child source, all other
+ // sources must be READY before we could even
+ // begin executing!
+ return SrcType_READY;
}
public String toString() {
- return refVars+"\tref "+addrVar+"\t@"+sese.getPrettyIdentifier()+"("+seseAge+")";
+ return refVars+"\tref "+addrVar+"\t@"+sese.toPrettyString()+"("+seseAge+")";
}
}
import Analysis.MLP.ParentChildConflictsMap;
import Analysis.MLP.SESELock;
import Analysis.MLP.VariableSourceToken;
+import Analysis.MLP.VSTWrapper;
import Analysis.MLP.CodePlan;
import Analysis.MLP.SESEandAgePair;
import Analysis.MLP.WaitingElement;
output.println(" /* static SESE names */");
Iterator<SESEandAgePair> pItr = callerSESEplaceholder.getNeededStaticNames().iterator();
while( pItr.hasNext() ) {
- SESEandAgePair p = pItr.next();
- output.println(" void* "+p+";");
+ SESEandAgePair pair = pItr.next();
+ output.println(" void* "+pair+";");
}
// declare variables for tracking dynamic sources
for(int i=0; i<objecttemps.numPointers(); i++) {
TempDescriptor temp=objecttemps.getPointer(i);
- if( fsen.getPrettyIdentifier().equals( "calc" ) ) {
- System.out.println( " got a pointer "+temp );
- }
-
if (temp.getType().isNull())
outputStructs.println(" void * "+temp.getSafeSymbol()+";");
else
output.println(" /* static SESE names */");
Iterator<SESEandAgePair> pItr = fsen.getNeededStaticNames().iterator();
while( pItr.hasNext() ) {
- SESEandAgePair p = pItr.next();
- output.println(" void* "+p+";");
+ SESEandAgePair pair = pItr.next();
+ output.println(" void* "+pair+";");
}
// declare variables for tracking dynamic sources
TempObject objecttemps=(TempObject) tempstable.get(lb!=null ? lb : md!=null ? md : task);
if (objecttemps.isLocalPrim(td)||objecttemps.isParamPrim(td)) {
- //System.out.println("generateTemp returns " + td.getSafeSymbol());
return td.getSafeSymbol();
}
while( vstItr.hasNext() ) {
VariableSourceToken vst = vstItr.next();
- SESEandAgePair p = new SESEandAgePair( vst.getSESE(), vst.getAge() );
+ SESEandAgePair pair = new SESEandAgePair( vst.getSESE(), vst.getAge() );
output.println(" {");
- output.println(" SESEcommon* common = (SESEcommon*) "+p+";");
+ output.println(" SESEcommon* common = (SESEcommon*) "+pair+";");
output.println(" pthread_mutex_lock( &(common->lock) );");
output.println(" while( common->doneExecuting == FALSE ) {");
output.println(" pthread_cond_wait( &(common->doneCond), &(common->lock) );");
output.println(" }");
output.println(" pthread_mutex_unlock( &(common->lock) );");
-
- //output.println(" psem_take( &(common->stallSem) );");
// copy things we might have stalled for
- output.println(" "+p.getSESE().getSESErecordName()+"* child = ("+
- p.getSESE().getSESErecordName()+"*) "+p+";");
+ output.println(" "+pair.getSESE().getSESErecordName()+"* child = ("+
+ pair.getSESE().getSESErecordName()+"*) "+pair+";");
Iterator<TempDescriptor> tdItr = cp.getCopySet( vst ).iterator();
while( tdItr.hasNext() ) {
// dynamic source vars to the current SESE
dynItr = cp.getDynAssignCurr().iterator();
while( dynItr.hasNext() ) {
- TempDescriptor dynVar = dynItr.next();
-
- // I would like to change the analysis, IF POSSIBLE, to "push" unneeded
- // variable source tokens away while analyzing a child and "pop" them
- // back at the child exit, otherwise we sometimes think we should inject
- // the following code inside a child that is for a parent's variable--in other
- // words the variable is not dynamically tracked for the child, but should
- // be by the parent. Quick fix is to use test to rule out whether we do this
- if( currentSESE.getDynamicVarSet().contains(dynVar) ) {
- output.println(" "+dynVar+"_srcSESE = NULL;");
- }
+ TempDescriptor dynVar = dynItr.next();
+ assert currentSESE.getDynamicVarSet().contains( dynVar );
+ output.println(" "+dynVar+"_srcSESE = NULL;");
}
// eom
output.println(" seseToIssue->"+dynInVar+"_srcSESE = "+dynInVar+"_srcSESE;");
}
- // maintain pointers for for finding dynamic SESE
+ // maintain pointers for finding dynamic SESE
// instances from static names
- SESEandAgePair p = new SESEandAgePair( fsen, 0 );
+ SESEandAgePair pair = new SESEandAgePair( fsen, 0 );
if( fsen.getParent() != null &&
//!fsen.getParent().getIsCallerSESEplaceholder() &&
- fsen.getParent().getNeededStaticNames().contains( p )
+ fsen.getParent().getNeededStaticNames().contains( pair )
) {
for( int i = fsen.getOldestAgeToTrack(); i > 0; --i ) {
- SESEandAgePair p1 = new SESEandAgePair( fsen, i );
- SESEandAgePair p2 = new SESEandAgePair( fsen, i-1 );
- output.println(" "+p1+" = "+p2+";");
+ SESEandAgePair pair1 = new SESEandAgePair( fsen, i );
+ SESEandAgePair pair2 = new SESEandAgePair( fsen, i-1 );
+ output.println(" "+pair1+" = "+pair2+";");
}
- output.println(" "+p+" = seseToIssue;");
+ output.println(" "+pair+" = seseToIssue;");
}
}
throw new Error("Unexpected presence of FlatWriteDynamicVarNode");
}
- Hashtable<TempDescriptor, VariableSourceToken> writeDynamic =
- fwdvn.getVar2src();
+ Hashtable<TempDescriptor, VSTWrapper> writeDynamic = fwdvn.getVar2src();
assert writeDynamic != null;
Iterator wdItr = writeDynamic.entrySet().iterator();
while( wdItr.hasNext() ) {
- Map.Entry me = (Map.Entry) wdItr.next();
- TempDescriptor refVar = (TempDescriptor) me.getKey();
- VariableSourceToken vst = (VariableSourceToken) me.getValue();
-
- FlatSESEEnterNode current = fwdvn.getEnclosingSESE();
+ Map.Entry me = (Map.Entry) wdItr.next();
+ TempDescriptor refVar = (TempDescriptor) me.getKey();
+ VSTWrapper vstW = (VSTWrapper) me.getValue();
+ VariableSourceToken vst = vstW.vst;
+ /*
// only do this if the variable in question should be tracked,
// meaning that it was explicitly added to the dynamic var set
if( !current.getDynamicVarSet().contains( vst.getAddrVar() ) ) {
continue;
}
+ */
- SESEandAgePair instance = new SESEandAgePair( vst.getSESE(), vst.getAge() );
-
- output.println(" {");
-
- if( current.equals( vst.getSESE() ) ) {
- // if the src comes from this SESE, it's a method local variable,
+ if( vst == null ) {
+ // if there is no given source, this variable is ready so
// mark src pointer NULL to signify that the var is up-to-date
- output.println(" "+vst.getAddrVar()+"_srcSESE = NULL;");
-
- } else {
- // otherwise we track where it will come from
- output.println(" "+vst.getAddrVar()+"_srcSESE = "+instance+";");
- output.println(" "+vst.getAddrVar()+"_srcOffset = (int) &((("+
- vst.getSESE().getSESErecordName()+"*)0)->"+vst.getAddrVar()+");");
+ output.println(" "+refVar+"_srcSESE = NULL;");
+ continue;
}
- output.println(" }");
+ // otherwise we track where it will come from
+ SESEandAgePair instance = new SESEandAgePair( vst.getSESE(), vst.getAge() );
+ output.println(" "+refVar+"_srcSESE = "+instance+";");
+ output.println(" "+refVar+"_srcOffset = (int) &((("+
+ vst.getSESE().getSESErecordName()+"*)0)->"+vst.getAddrVar()+");");
}
}
public String toString() {
return "sese "+getPrettyIdentifier()+" enter";
}
+
+ public String toPrettyString() {
+ return "sese "+getPrettyIdentifier()+getIdentifier();
+ }
public void setParent( FlatSESEEnterNode parent ) {
this.parent = parent;
package IR.Flat;
-import Analysis.MLP.VariableSourceToken;
+import Analysis.MLP.VSTWrapper;
import java.util.Hashtable;
protected FlatNode tailNode;
protected FlatNode headNode;
- protected Hashtable<TempDescriptor, VariableSourceToken> var2src;
+ protected Hashtable<TempDescriptor, VSTWrapper> var2src;
protected FlatSESEEnterNode enclosingSESE;
public FlatWriteDynamicVarNode( FlatNode t,
FlatNode h,
- Hashtable<TempDescriptor, VariableSourceToken> v2s,
+ Hashtable<TempDescriptor, VSTWrapper> v2s,
FlatSESEEnterNode c
) {
tailNode = t;
this.addNext( headNode );
}
- public void addMoreVar2Src( Hashtable<TempDescriptor, VariableSourceToken> more ) {
+ public void addMoreVar2Src( Hashtable<TempDescriptor, VSTWrapper> more ) {
var2src.putAll( more );
}
- public Hashtable<TempDescriptor, VariableSourceToken> getVar2src() {
+ public Hashtable<TempDescriptor, VSTWrapper> getVar2src() {
return var2src;
}
Analysis/Disjoint/ReachGraph.class \
Analysis/MLP/MLPAnalysis.class \
Analysis/MLP/VariableSourceToken.class \
+Analysis/MLP/VSTWrapper.class \
Analysis/MLP/SVKey.class \
Analysis/MLP/VarSrcTokTable.class \
Analysis/MLP/CodePlan.class \
BUILDSCRIPT=~/research/Robust/src/buildscript
-USEMLP= -mlp 8 2 -mlpdebug # use to turn mlp on and off and make sure rest of build not broken
-BSFLAGS= -nooptimize -debug -garbagestats -mainclass Test -ownership -ownallocdepth 1 -enable-assertions -ownaliasfile aliases.txt
+USEMLP= -mlp 8 2 -mlpdebug -methodeffects -ownership -ownallocdepth 1 -ownaliasfile aliases.txt
+BSFLAGS= -nooptimize -debug -garbagestats -mainclass Test -enable-assertions
all: $(PROGRAM1).bin $(PROGRAM2).bin
$(PROGRAM1).bin: $(SOURCE_FILES)
$(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM1) $(SOURCE_FILES)
+ rm -fr tmpbuilddirectory
$(PROGRAM2).bin: $(SOURCE_FILES)
$(BUILDSCRIPT) $(USEMLP) $(BSFLAGS) -o $(PROGRAM2) $(SOURCE_FILES)
rm -f *.png
rm -f aliases.txt
rm -f mlpReport*txt
+ rm -f MethodEffects*txt
rm -f results*txt
./testMulti.bin $[ i ] >> resultsMulti.txt
./testSingle.bin $[ i*7 ] >> resultsSingle.txt
./testMulti.bin $[ i*7 ] >> resultsMulti.txt
-./testSingle.bin $[ 50+i*7 ] >> resultsSingle.txt
-./testMulti.bin $[ 50+i*7 ] >> resultsMulti.txt
+./testSingle.bin $[ 50+i*9 ] >> resultsSingle.txt
+./testMulti.bin $[ 50+i*9 ] >> resultsMulti.txt
done
echo 'Diffing results'
public static void main( String args[] ) {
int x = Integer.parseInt( args[0] );
Foo f = new Foo( x + 10000 );
- doSomeWork( x, f );
+ int s = doSomeWork( x, f );
+ int t = moreWork( x, f );
nullMethodBodyFinalNode();
+ int r = s+t;
+ System.out.println( "s+t="+r );
}
- public static void doSomeWork( int x, Foo f ) {
+ public static int doSomeWork( int x, Foo f ) {
+ float delta = 1.0f;
for( int i = 0; i < x; ++i ) {
sese calc {
Foo g = new Foo( i );
int sum = 0;
- for( int j = 0; j <= i; ++j ) {
+ for( int j = 0; j <= i % 10; ++j ) {
sum = calculateStuff( sum, 1, 0 );
}
}
sese forceVirtualReal {
- if( i % 3 == 0 ) {
+ if( i % 7 == 0 ) {
sum = sum + (i % 20);
- }
+ }
+ for( int z = 0; z < x % 50; ++z ) {
+ if( i % 2 == 0 ) {
+ delta += 1.0f;
+ }
+ }
g.z = sum + 1000;
}
+ sese arrayAlloc {
+ int tempArray[] = new int[x];
+ for( int k = 0; k < x/20; ++k ) {
+ tempArray[k] = g.z / (i+1);
+ }
+ }
+ sese gather {
+ int inter = 1;
+ for( int k = 0; k < x/20; ++k ) {
+ inter = inter + tempArray[k];
+ }
+ sum = sum + inter / 10;
+ }
sese modobj {
g.z = g.z + f.z;
}
- if( i % 2 == 0 ) {
+ if( i % 11 == 0 ) {
sese change {
for( int k = 0; k < i*2; ++k ) {
sum = calculateStuff( sum, k, 1 );
}
}
sese prnt {
- mightPrint( x, i, sum, g );
+ mightPrint( x, i, sum + (int)delta, g );
}
}
+ return x;
}
public static int calculateStuff( int sum, int num, int mode ) {
return answer;
}
+ public static int moreWork( int x, Foo f ) {
+
+ int total = 0;
+
+ for( int j = 0; j < x; ++j ) {
+ sese doe {
+ Foo g = new Foo( j );
+ int prod = 1;
+ }
+ sese rae {
+ if( j % 7 == 0 ) {
+ prod = prod * j;
+ }
+ g.z = prod / x;
+ }
+ sese mi {
+ g.z = g.z + f.z;
+ }
+ if( j % 3 == 0 ) {
+ sese fa {
+ prod = prod / 2;
+ }
+ }
+
+ total = total + prod - g.z;
+ }
+
+ return total;
+ }
+
public static void nullMethodBodyFinalNode() {
int y = 1;
sese nothing {
BUILDSCRIPT=~/research/Robust/src/buildscript
-USEMLP= -mlp 8 2 -mlpdebug # use to turn mlp on and off and make sure rest of build not broken
-BSFLAGS= -nooptimize -debug -garbagestats -mainclass Test -ownership -ownallocdepth 1 -enable-assertions -ownaliasfile aliases.txt
+USEMLP= -mlp 8 2 -mlpdebug -methodeffects -ownership -ownallocdepth 1 -ownaliasfile aliases.txt
+BSFLAGS= -nooptimize -debug -garbagestats -mainclass Test -enable-assertions
all: $(PROGRAM1).bin $(PROGRAM2).bin
$(PROGRAM1).bin: $(SOURCE_FILES)
$(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM1) $(SOURCE_FILES)
+ rm -fr tmpbuilddirectory
$(PROGRAM2).bin: $(SOURCE_FILES)
$(BUILDSCRIPT) $(USEMLP) $(BSFLAGS) -o $(PROGRAM2) $(SOURCE_FILES)
rm -f *.png
rm -f aliases.txt
rm -f mlpReport*txt
+ rm -f MethodEffects*txt
rm -f results*txt
./testMulti.bin $[ i ] >> resultsMulti.txt
./testSingle.bin $[ i*7 ] >> resultsSingle.txt
./testMulti.bin $[ i*7 ] >> resultsMulti.txt
-./testSingle.bin $[ 50+i*7 ] >> resultsSingle.txt
-./testMulti.bin $[ 50+i*7 ] >> resultsMulti.txt
+./testSingle.bin $[ 50+i*9 ] >> resultsSingle.txt
+./testMulti.bin $[ 50+i*9 ] >> resultsMulti.txt
done
echo 'Diffing results'
public static void main( String args[] ) {
int x = Integer.parseInt( args[0] );
Foo f = new Foo( x + 10000 );
- doSomeWork( x, f );
+ int s = doSomeWork( x, f );
+ int t = moreWork( x, f );
+ int r = s+t;
+ System.out.println( "s+t="+r );
}
- public static void doSomeWork( int x, Foo f ) {
-
+ public static int doSomeWork( int x, Foo f ) {
int total = 0;
+ float delta = 0.0f;
- for( int i = 0; i < x; ++i ) {
- sese calc {
- Foo g = new Foo( i );
- int sum = 0;
- }
- sese forceVirtualReal {
- if( i % 3 == 0 ) {
- sum = sum + (i % 20);
- }
- g.z = sum + 1000;
+ for( int i = 0; i < 10; ++i ) {
+ sese parallel {
+ int[] d = new int[1];
+ d[0] = 2*i;
+ //int d = 2*i;
}
- sese modobj {
- g.z = g.z + f.z;
+ sese waste {
+ if( true ) {
+ total = total + 1 + d[0];
+ //total = total + 1 + d;
+ }
+
+ for( int j=0; j < 1; ++j ) {
+ if( true ) {
+ delta += 1.0f;
+ }
+ }
}
- if( i % 2 == 0 ) {
- sese change {
- sum = sum + 1;
- }
- }
- total = total + sum + g.z;
- }
+ }
+ int temp = 100 + total + (int)delta;
+ return x + temp;
+ }
- sese prnt {
- System.out.println( "Results "+x+", "+total );
- }
+ public static int moreWork( int x, Foo f ) {
+ return f.z - 9000;
}
}