From: bdemsky Date: Fri, 3 Jul 2009 22:46:47 +0000 (+0000) Subject: changes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0b4a16c788b388f8322060dff317869ced9e5553;p=IRC.git changes --- diff --git a/Robust/src/Analysis/Locality/DelayComputation.java b/Robust/src/Analysis/Locality/DelayComputation.java index c9c16d4e..b7c48bbf 100644 --- a/Robust/src/Analysis/Locality/DelayComputation.java +++ b/Robust/src/Analysis/Locality/DelayComputation.java @@ -40,13 +40,18 @@ public class DelayComputation { return dcopts; } + public Hashtable> getCannotDelayMap() { + return cannotdelaymap; + } + public void doAnalysis() { Set localityset=locality.getLocalityBindings(); for(Iterator lbit=localityset.iterator();lbit.hasNext();) { analyzeMethod(lbit.next()); } - dcopts=new DiscoverConflicts(locality, state, typeanalysis, cannotdelaymap); + //ignore things that aren't in the map + dcopts=new DiscoverConflicts(locality, state, typeanalysis, cannotdelaymap, false, false); dcopts.doAnalysis(); diff --git a/Robust/src/Analysis/Locality/DiscoverConflicts.java b/Robust/src/Analysis/Locality/DiscoverConflicts.java index e9127ae3..6dfc4a27 100644 --- a/Robust/src/Analysis/Locality/DiscoverConflicts.java +++ b/Robust/src/Analysis/Locality/DiscoverConflicts.java @@ -26,7 +26,8 @@ public class DiscoverConflicts { TypeAnalysis typeanalysis; Hashtable>cannotdelaymap; Hashtable>>> lbtofnmap; - + boolean inclusive=false; + boolean normalassign=false; public DiscoverConflicts(LocalityAnalysis locality, State state, TypeAnalysis typeanalysis) { this.locality=locality; @@ -42,7 +43,7 @@ public class DiscoverConflicts { lbtofnmap=new Hashtable>>>(); } - public DiscoverConflicts(LocalityAnalysis locality, State state, TypeAnalysis typeanalysis, Hashtable> cannotdelaymap) { + public DiscoverConflicts(LocalityAnalysis locality, State state, TypeAnalysis typeanalysis, Hashtable> cannotdelaymap, boolean inclusive, boolean normalassign) { this.locality=locality; this.fields=new HashSet(); this.arrays=new HashSet(); @@ -55,6 +56,8 @@ public class DiscoverConflicts { leftsrcmap=new Hashtable>(); rightsrcmap=new Hashtable>(); lbtofnmap=new Hashtable>>>(); + this.inclusive=inclusive; + this.normalassign=normalassign; } public Set getFields() { @@ -294,8 +297,8 @@ public class DiscoverConflicts { for(Iterator fnit=fm.getNodeSet().iterator();fnit.hasNext();) { FlatNode fn=fnit.next(); - //Check whether this node matters for delayed computation - if (cannotdelaymap!=null&&cannotdelaymap.containsKey(lb)&&!cannotdelaymap.get(lb).contains(fn)) + //Check whether this node matters for cannot delayed computation + if (cannotdelaymap!=null&&cannotdelaymap.containsKey(lb)&&cannotdelaymap.get(lb).contains(fn)==inclusive) continue; Hashtable atomictable=locality.getAtomic(lb); @@ -432,9 +435,13 @@ public class DiscoverConflicts { } case FKind.FlatOpNode: { FlatOpNode fon=(FlatOpNode)fn; - if (fon.getOp().getOp()==Operation.ASSIGN&&fon.getDest().getType().isPtr()&& - ttofn.containsKey(fon.getLeft())) { - ttofn.put(fon.getDest(), new HashSet(ttofn.get(fon.getLeft()))); + if (fon.getOp().getOp()==Operation.ASSIGN&&fon.getDest().getType().isPtr()) { + HashSet set=new HashSet(); + if (ttofn.containsKey(fon.getLeft())) + set.addAll(ttofn.get(fon.getLeft())); + if (normalassign) + set.add(new TempFlatPair(fon.getDest(), fn)); + ttofn.put(fon.getDest(), set); break; } } diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 5c0991fa..80a21860 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -69,6 +69,7 @@ public class BuildCode { boolean nonSESEpass=true; WriteBarrier wb; DiscoverConflicts dc; + DiscoverConflicts recorddc; DelayComputation delaycomp; CallGraph callgraph; @@ -117,6 +118,7 @@ public class BuildCode { delaycomp=new DelayComputation(locality, st, typeanalysis, gft); delaycomp.doAnalysis(); dc=delaycomp.getConflicts(); + recorddc=new DiscoverConflicts(locality, st, typeanalysis, delaycomp.getCannotDelayMap(), true, true); } if(state.MLP) { @@ -1994,7 +1996,12 @@ public class BuildCode { if (firstpass) { //need to store value written by previous node if (wrtmp.getType().isPtr()) { - output.println("STOREPTR("+generateTemp(fm, wrtmp,lb)+");"); + //only lock the objects that may actually need locking + if (recorddc.getNeedTrans(lb, current_node)) { + output.println("STOREPTR("+generateTemp(fm, wrtmp,lb)+");"); + } else { + output.println("STOREPTRNOTRANS("+generateTemp(fm, wrtmp,lb)+");"); + } } else { output.println("STORE"+wrtmp.getType().getSafeDescriptor()+"("+generateTemp(fm, wrtmp, lb)+");"); }