From cc2d8156c4b202de8c66a71734794c6ab59c6a29 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 17 Apr 2008 00:29:31 +0000 Subject: [PATCH] make clearprefetch cache commands into barriers for prefetches --- .../Analysis/Prefetch/PrefetchAnalysis.java | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java index d2cbbe0d..196ecc9c 100644 --- a/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java +++ b/Robust/src/Analysis/Prefetch/PrefetchAnalysis.java @@ -100,6 +100,10 @@ public class PrefetchAnalysis { } } switch(curr.kind()) { + case FKind.FlatCall: + processCall((FlatCall)curr,child_prefetch_set_copy); + break; + case FKind.FlatBackEdge: case FKind.FlatCheckNode: case FKind.FlatReturnNode: @@ -110,7 +114,6 @@ public class PrefetchAnalysis { case FKind.FlatNop: case FKind.FlatNew: case FKind.FlatCastNode: - case FKind.FlatCall: case FKind.FlatTagDeclaration: processDefaultCase(curr,child_prefetch_set_copy); break; @@ -745,6 +748,34 @@ public class PrefetchAnalysis { updatePairMap(curr, pm, 0); updatePrefetchSet(curr, tocompare); } + + /** If FlatNode is not concerned with the prefetch set of its Child then propagate + * prefetches up the FlatNode*/ + private void processCall(FlatCall curr, Hashtable child_prefetch_set_copy) { + PairMap pm = new PairMap(); + Hashtable tocompare = new Hashtable(); + + /* Don't propagate prefetches across cache clear */ + if (!curr.getMethod().getClassMethodName().equals("System.clearPrefetchCache")) { + /* Propagate all child nodes */ + nexttemp: + for(Enumeration e = child_prefetch_set_copy.keys(); e.hasMoreElements();) { + PrefetchPair childpp = (PrefetchPair) e.nextElement(); + TempDescriptor[] writearray=curr.writesTemps(); + for(int i=0;i