variableAnalysisForward( fm );
}
-
// 4th pass, compute liveness contribution from
// virtual reads discovered in variable pass
rootItr = rootSESEs.iterator();
}
+ /*
+ SOMETHING IS WRONG WITH THIS, DON'T USE IT UNTIL IT CAN BE FIXED
+
// 5th pass
methItr = ownAnalysis.descriptorsToAnalyze.iterator();
while( methItr.hasNext() ) {
// by removing reference variables that are not live
pruneVariableResultsWithLiveness( fm );
}
-
+ */
+
// 6th pass
methItr = ownAnalysis.descriptorsToAnalyze.iterator();
Set<TempDescriptor> rootLiveSet = livenessRootView.get( fn );
VarSrcTokTable vstTable = variableResults.get( fn );
- // fix later, not working, only wanted it to make tables easier to read
vstTable.pruneByLiveness( rootLiveSet );
for( int i = 0; i < fn.numNext(); i++ ) {
// along various control paths, and therefore when we stall,
// just stall for the exact thing we need and move on
plan.addDynamicStall( readtmp );
- currentSESE.addDynamicVar( readtmp );
+ currentSESE.addDynamicVar( readtmp );
} else if( srcType.equals( VarSrcTokTable.SrcType_STATIC ) ) {
// 2) Single token/age pair: Stall for token/age pair, and copy
FlatSESEEnterNode fsen,
PrintWriter output
) {
+
+ // if MLP flag is off, okay that SESE nodes are in IR graph,
+ // just skip over them and code generates exactly the same
if( !state.MLP ) {
- // SESE nodes can be parsed for normal compilation, just skip over them
return;
}
+ // there may be an SESE in an unreachable method, skip over
+ if( !mlpa.getAllSESEs().contains( fsen ) ) {
+ return;
+ }
+
// also, if we have encountered a placeholder, just skip it
if( fsen.getIsCallerSESEplaceholder() ) {
return;
FlatSESEExitNode fsexn,
PrintWriter output
) {
+
+ // if MLP flag is off, okay that SESE nodes are in IR graph,
+ // just skip over them and code generates exactly the same
if( !state.MLP ) {
- // SESE nodes can be parsed for normal compilation, just skip over them
+ return;
+ }
+
+ // there may be an SESE in an unreachable method, skip over
+ if( !mlpa.getAllSESEs().contains( fsexn.getFlatEnter() ) ) {
return;
}
String com = paramsprefix+"->common";
- /*
- // take yourself off the thread-local sese call stack
- output.println(" if( isEmpty( seseCallStack ) ) {");
- output.println(" printf( \"Error, sese call stack is empty.\\n\" );");
- output.println(" exit( -1 );");
- output.println(" }");
- output.println(" if( (void*)"+paramsprefix+" != getItem( seseCallStack ) ) {");
- output.println(" printf( \"Error, sese call stack mismatch.\\n\" );");
- output.println(" exit( -1 );");
- output.println(" }");
- */
-
// this SESE cannot be done until all of its children are done
// so grab your own lock with the condition variable for watching
// that the number of your running children is greater than zero
echo '' > resultsSingle.txt
echo '' > resultsMulti.txt
-for i in $(seq 5)
+for i in $(seq 20)
do
echo 'running...'
-./testSingle.bin 10 >> resultsSingle.txt
-./testMulti.bin 10 >> resultsMulti.txt
-./testSingle.bin 25 >> resultsSingle.txt
-./testMulti.bin 25 >> resultsMulti.txt
-./testSingle.bin 125 >> resultsSingle.txt
-./testMulti.bin 125 >> resultsMulti.txt
-./testSingle.bin 1255 >> resultsSingle.txt
-./testMulti.bin 1255 >> resultsMulti.txt
+./testSingle.bin $[ i ] >> resultsSingle.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
done
echo 'Diffing results'
public static int calculateStuff( int sum, int num, int mode ) {
int answer = sum;
+ sese makePlaceholderStallAfter {
+ sum = sum + 1;
+ }
+ sum = sum + 1;
if( mode == 0 ) {
sese mode1 {
answer = sum + num;
public static void main( String args[] ) {
int x = Integer.parseInt( args[0] );
doSomeWork( x );
- nullMethodBodyFinalNode();
}
public static void doSomeWork( int x ) {
for( int i = 0; i < x; ++i ) {
sese calc {
- int sum = 0;
+ int sum = 0;
for( int j = 0; j <= i; ++j ) {
sum = calculateStuff( sum, 1, 0 );
- }
- }
+ }
+ }
sese forceVirtualReal {
if( i % 3 == 0 ) {
sum = sum + (i % 20);
}
- }
+ }
if( i % 2 == 0 ) {
sese change {
for( int k = 0; k < i*2; ++k ) {
for( int l = 0; l < 3; ++l ) {
sum = calculateStuff( sum, 2, 2 );
}
- }
+ }
sese prnt {
mightPrint( x, i, sum );
}
}
public static int calculateStuff( int sum, int num, int mode ) {
- int answer = sum;
+ int answer = sum;
+ sese makePlaceholderStallAfter {
+ sum = sum + 1;
+ }
+ sum = sum + 1;
if( mode == 0 ) {
sese mode1 {
answer = sum + num;
sese mode2 {
answer = sum + (num/2);
}
- } else {
+ } else if( mode == 2 ) {
sese mode3 {
- answer = sum / num;
+ answer = sum + (num/2);
}
}
- return answer;
- }
- public static void nullMethodBodyFinalNode() {
- int y = 1;
- sese nothing {
- int x = 0;
- }
- y = x;
- if( x > y ) {
- return;
- } else {
- return;
- }
+ return answer;
}
public static void mightPrint( int x, int i, int sum ) {