From a0277d401fc40b364f36e9a1e84833c6f06020c4 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 25 Mar 2008 02:13:14 +0000 Subject: [PATCH] more changes --- .../Analysis/Prefetch/PrefetchAnalysis.java | 27 ++++++++++--------- .../Prefetch/MatrixMultiply/makefile | 2 +- Robust/src/IR/Flat/BuildCode.java | 19 ++++++------- Robust/src/Main/Main.java | 4 +-- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java index 3e808081..f72517a5 100644 --- a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java +++ b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java @@ -102,20 +102,21 @@ public class PrefetchAnalysis { /** This function calls analysis for every method in a class */ private void doMethodAnalysis(ClassDescriptor cn) { - Iterator methodit=cn.getMethods(); - while(methodit.hasNext()) { - Hashtable> newprefetchset = new Hashtable>(); - MethodDescriptor md=(MethodDescriptor)methodit.next(); - FlatMethod fm=state.getMethodFlat(md); - doFlatNodeAnalysis(fm); - doInsPrefetchAnalysis(fm, newprefetchset); - if(newprefetchset.size() > 0) { - addFlatPrefetchNode(newprefetchset); - } - newprefetchset = null; - } + for (Iterator methodit=cn.getMethods();methodit.hasNext();) { + MethodDescriptor md=(MethodDescriptor)methodit.next(); + if (state.excprefetch.contains(md.getClassMethodName())) + continue; //Skip this method + Hashtable> newprefetchset = new Hashtable>(); + FlatMethod fm=state.getMethodFlat(md); + doFlatNodeAnalysis(fm); + doInsPrefetchAnalysis(fm, newprefetchset); + if(newprefetchset.size() > 0) { + addFlatPrefetchNode(newprefetchset); + } + newprefetchset = null; + } } - + /** This function calls analysis for every node in a method */ private void doFlatNodeAnalysis(FlatMethod fm) { tovisit = fm.getNodeSet(); diff --git a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile b/Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile index f37a0459..2995827f 100644 --- a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile +++ b/Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile @@ -1,6 +1,6 @@ MAINCLASS=MatrixMultiply SRC=${MAINCLASS}.java -FLAGS=-dsm -prefetch -optimize -printflat -profile -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.8 +FLAGS=-dsm -prefetch -optimize -printflat -profile -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.5 FLAGS2=-dsm -optimize -printflat -profile -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -o ${MAINCLASS}NP default: ../../../buildscript ${FLAGS2} ${SRC} diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 19e39ccf..5515266d 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -1435,16 +1435,11 @@ public class BuildCode { } public void generateFlatPrefetchNode(FlatMethod fm, LocalityBinding lb, FlatPrefetchNode fpn, PrintWriter output) { - Vector oids = new Vector(); - Vector fieldoffset = new Vector(); - Vector endoffset = new Vector(); - int tuplecount = 0; //Keeps track of number of prefetch tuples that need to be generated - if (state.PREFETCH) { - output.println("{"); - output.println("/* prefetch */"); - output.println("void * prefptr;"); - output.println("int tmpindex;"); + Vector oids = new Vector(); + Vector fieldoffset = new Vector(); + Vector endoffset = new Vector(); + int tuplecount = 0; //Keeps track of number of prefetch tuples that need to be generated for(Iterator it = fpn.hspp.iterator();it.hasNext();) { PrefetchPair pp = (PrefetchPair) it.next(); Integer statusbase = locality.getNodePreTempInfo(lb,fpn).get(pp.base); @@ -1460,8 +1455,10 @@ public class BuildCode { } if (tuplecount==0) return; - - + output.println("{"); + output.println("/* prefetch */"); + output.println("void * prefptr;"); + output.println("int tmpindex;"); /*Create C code for oid array */ output.print(" unsigned int oidarray_[] = {"); boolean needcomma=false; diff --git a/Robust/src/Main/Main.java b/Robust/src/Main/Main.java index b06f3154..ef0c3d1a 100644 --- a/Robust/src/Main/Main.java +++ b/Robust/src/Main/Main.java @@ -65,9 +65,9 @@ public class Main { ClassLibraryPrefix=args[++i]+"/"; else if (option.equals("-mainclass")) state.main=args[++i]; - else if (option.equals("-trueprob")) + else if (option.equals("-trueprob")) { state.TRUEPROB=Double.parseDouble(args[++i]); - else if (option.equals("-printflat")) + } else if (option.equals("-printflat")) State.PRINTFLAT=true; else if (option.equals("-struct")) state.structfile=args[++i]; -- 2.34.1