From adfb4272ea373f4b6dea801090385a47815b473e Mon Sep 17 00:00:00 2001 From: bdemsky Date: Tue, 25 Mar 2008 06:44:04 +0000 Subject: [PATCH] changes --- .../Analysis/Prefetch/PrefetchAnalysis.java | 113 ++---------------- .../Prefetch/MatrixMultiply/makefile | 2 +- Robust/src/buildscript | 2 +- 3 files changed, 15 insertions(+), 102 deletions(-) diff --git a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java index 34456524..9b9672ca 100644 --- a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java +++ b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java @@ -113,19 +113,16 @@ public class PrefetchAnalysis { case FKind.FlatFlagActionNode: case FKind.FlatGlobalConvNode: case FKind.FlatNop: - processDefaultCase(curr,child_prefetch_set_copy); - break; + case FKind.FlatNew: + case FKind.FlatCastNode: case FKind.FlatCall: - //TODO change it to take care of FlatMethod, Flatcalls - processFlatCall(curr, child_prefetch_set_copy); + case FKind.FlatTagDeclaration: + processDefaultCase(curr,child_prefetch_set_copy); break; case FKind.FlatMethod: //TODO change it to take care of FlatMethod, Flatcalls processFlatMethod(curr, child_prefetch_set_copy); break; - case FKind.FlatNew: - processFlatNewNode(curr, child_prefetch_set_copy); - break; case FKind.FlatFieldNode: processFlatFieldNode(curr, child_prefetch_set_copy); break; @@ -144,12 +141,6 @@ public class PrefetchAnalysis { case FKind.FlatSetFieldNode: processFlatSetFieldNode(curr, child_prefetch_set_copy); break; - case FKind.FlatCastNode: - processFlatCastNode(curr, child_prefetch_set_copy); - break; - case FKind.FlatTagDeclaration: - processFlatTagDeclaration(curr, child_prefetch_set_copy); - break; default: throw new Error("No such Flatnode kind"); } @@ -684,27 +675,6 @@ public class PrefetchAnalysis { updatePrefetchSet(curr, tocompare); } - /** This Function processes the FlatCalls - * It currently drops the propagation of those prefetchpairs whose base is - * same as the destination of the FlatCall - */ - private void processFlatCall(FlatNode curr, Hashtable child_prefetch_set_copy) { - Hashtable tocompare = new Hashtable(); - FlatCall currfcn = (FlatCall) curr; - PairMap pm = new PairMap(); - for (Enumeration ecld = child_prefetch_set_copy.keys();ecld.hasMoreElements();) { - PrefetchPair childpp = (PrefetchPair) ecld.nextElement(); - PrefetchPair copyofchildpp = (PrefetchPair) childpp.clone(); - if(currfcn.getReturnTemp() != childpp.base) { - tocompare.put(childpp, child_prefetch_set_copy.get(childpp).doubleValue()); - pm.addPair(childpp, childpp); - } - } - - updatePairMap(curr, pm, 0); - updatePrefetchSet(curr, tocompare); - } - /** This function handles the processes the FlatNode of type FlatCondBranch * It combines prefetches of both child elements and create a new hash table called * branch_prefetch_set to contains the entries of both its children @@ -792,75 +762,18 @@ public class PrefetchAnalysis { Hashtable tocompare = new Hashtable(); /* Propagate all child nodes */ + nexttemp: for(Enumeration e = child_prefetch_set_copy.keys(); e.hasMoreElements();) { PrefetchPair childpp = (PrefetchPair) e.nextElement(); - tocompare.put(childpp, child_prefetch_set_copy.get(childpp).doubleValue()); - pm.addPair(childpp, childpp); - } - - updatePairMap(curr, pm, 0); - updatePrefetchSet(curr, tocompare); - } - - /** This functions processes for FlatNewNode - * for e.g x = NEW(foo) followed by childnode with prefetch set x.f - * then drop the prefetches beyond this FlatNewNode */ - private void processFlatNewNode(FlatNode curr, Hashtable child_prefetch_set_copy) { - Hashtable tocompare = new Hashtable(); - FlatNew currfnn = (FlatNew) curr; - Double newprob = new Double(0.0); - PairMap pm = new PairMap(); - - for (Enumeration ecld = child_prefetch_set_copy.keys();ecld.hasMoreElements();) { - PrefetchPair childpp = (PrefetchPair) ecld.nextElement(); - if(childpp.base != currfnn.getDst()&& - !childpp.containsTemp(currfnn.getDst())) { - tocompare.put(childpp, child_prefetch_set_copy.get(childpp)); - pm.addPair(childpp, childpp); - } - } - - updatePairMap(curr, pm, 0); - updatePrefetchSet(curr, tocompare); - } - - /** This functions processes for FlatCastNode - * for e.g x = (cast type) y followed by childnode with prefetch set x.f - * then drop the prefetches beyond this FlatCastNode */ - private void processFlatCastNode(FlatNode curr, Hashtablechild_prefetch_set_copy) { - Hashtable tocompare = new Hashtable(); - FlatCastNode currfcn = (FlatCastNode) curr; - Double newprob = new Double(0.0); - PairMap pm = new PairMap(); - for (Enumeration ecld = child_prefetch_set_copy.keys();ecld.hasMoreElements();) { - PrefetchPair childpp = (PrefetchPair) ecld.nextElement(); - if(childpp.base != currfcn.getDst()&& - !childpp.containsTemp(currfcn.getDst())) { - tocompare.put(childpp, child_prefetch_set_copy.get(childpp)); - pm.addPair(childpp, childpp); - } - } - - updatePairMap(curr, pm, 0); - updatePrefetchSet(curr, tocompare); - } - - /** This functions processes for FlatTagDeclaration - * for e.g x = (cast type) y followed by childnode with prefetch set x.f - * then drop the prefetches beyond this FlatTagDeclaration */ - private void processFlatTagDeclaration(FlatNode curr, Hashtablechild_prefetch_set_copy) { - Hashtable tocompare = new Hashtable(); - FlatTagDeclaration currftd = (FlatTagDeclaration) curr; - Double newprob = new Double(0.0); - PairMap pm = new PairMap(); - - for (Enumeration ecld = child_prefetch_set_copy.keys();ecld.hasMoreElements();) { - PrefetchPair childpp = (PrefetchPair) ecld.nextElement(); - if(childpp.base != currftd.getDst()&& - !childpp.containsTemp(currftd.getDst())) { - tocompare.put(childpp, child_prefetch_set_copy.get(childpp).doubleValue()); - pm.addPair(childpp, childpp); + TempDescriptor[] writearray=curr.writesTemps(); + for(int i=0;i