From: yeom Date: Thu, 21 Oct 2010 02:45:19 +0000 (+0000) Subject: simple changes: X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=974f8efa1c977e3220f530ce4ba72e0db7583c00;p=IRC.git simple changes: if there are more than one coarse conflicts for the same queue and the same sese, one coarse waiting element, which is actually enqueued into the memory queue, maintains a set of tempDesc containing all of the coarse tempDescriptors. have not yet modified BuildCode. --- diff --git a/Robust/src/Analysis/OoOJava/ConflictGraph.java b/Robust/src/Analysis/OoOJava/ConflictGraph.java index a7e07c93..09ea4687 100644 --- a/Robust/src/Analysis/OoOJava/ConflictGraph.java +++ b/Robust/src/Analysis/OoOJava/ConflictGraph.java @@ -627,6 +627,14 @@ public class ConflictGraph { if (SCCelement != null) { // if there is at lease one SCC element, just enqueue SCC and // ignore others. + if(state.RCR){ + // for rcr, we need to label all of coarse tempdescriptors + // here assume that all waiting elements are coarse + for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext();) { + WaitingElement waitingElement = (WaitingElement) iterator.next(); + SCCelement.addTempDesc(waitingElement.getTempDesc()); + } + } refinedSet.add(SCCelement); } else if (numCoarse == 1 && (numRead + numWrite + numCoarse == total)) { // if one is a coarse, the othere are reads/write, enqueue SCC. @@ -636,6 +644,13 @@ public class ConflictGraph { refinedSet.add(we); } else if (numCoarse == total) { // if there are multiple coarses, enqueue just one coarse. + if(state.RCR){ + // for rcr, we need to label all of coarse tempdescriptors + for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext();) { + WaitingElement waitingElement = (WaitingElement) iterator.next(); + coarseElement.addTempDesc(waitingElement.getTempDesc()); + } + } refinedSet.add(coarseElement); } else if (numWrite == total || (numRead + numWrite) == total) { // code generator is going to handle the case for multiple writes & diff --git a/Robust/src/Analysis/OoOJava/WaitingElement.java b/Robust/src/Analysis/OoOJava/WaitingElement.java index 35dc3b55..0f1b4e54 100644 --- a/Robust/src/Analysis/OoOJava/WaitingElement.java +++ b/Robust/src/Analysis/OoOJava/WaitingElement.java @@ -1,83 +1,101 @@ package Analysis.OoOJava; +import java.util.HashSet; +import java.util.Set; + import IR.Flat.TempDescriptor; public class WaitingElement { - private int queueID; - private int status; - private String dynID=""; - private TempDescriptor tempDesc; - - public void setTempDesc(TempDescriptor tempDesc){ - this.tempDesc=tempDesc; - } - - public TempDescriptor getTempDesc(){ - return tempDesc; - } - - public void setQueueID(int queueID) { - this.queueID = queueID; - } - - public String getDynID(){ - return dynID; - } - - public void setDynID(String dynID){ - this.dynID=dynID; - } - - public int getQueueID() { - return queueID; - } - - public void setStatus(int status) { - this.status = status; - } - - public int getStatus() { - return status; - } - - public boolean equals(Object o) { - - if (o == null) { - return false; - } - - if (!(o instanceof WaitingElement)) { - return false; - } - - WaitingElement in = (WaitingElement) o; - - if (queueID == in.getQueueID() && status == in.getStatus() && dynID.equals(in.getDynID()) ) { - return true; - } else { - return false; - } - - } - - public String toString() { - return "[waitingID=" + queueID + " status=" + status + " dynID=" - + dynID + "]"; - } - - public int hashCode() { - - int hash = 1; - - hash = hash * 31 + queueID; - - hash += status; - - hash += dynID.hashCode(); - - return hash; - - } + private int queueID; + private int status; + private String dynID = ""; + private TempDescriptor tempDesc; + + // a set of tempDescriptors: + // all associated with coarse conflicts for the same queue and the same sese + private Set tempSet; + + public WaitingElement() { + tempSet = new HashSet(); + } + + public void addTempDesc(TempDescriptor tempDesc) { + tempSet.add(tempDesc); + } + + public Set getTempDescSet() { + return tempSet; + } + + public void setTempDesc(TempDescriptor tempDesc) { + this.tempDesc = tempDesc; + } + + public TempDescriptor getTempDesc() { + return tempDesc; + } + + public void setQueueID(int queueID) { + this.queueID = queueID; + } + + public String getDynID() { + return dynID; + } + + public void setDynID(String dynID) { + this.dynID = dynID; + } + + public int getQueueID() { + return queueID; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getStatus() { + return status; + } + + public boolean equals(Object o) { + + if (o == null) { + return false; + } + + if (!(o instanceof WaitingElement)) { + return false; + } + + WaitingElement in = (WaitingElement) o; + + if (queueID == in.getQueueID() && status == in.getStatus() && dynID.equals(in.getDynID())) { + return true; + } else { + return false; + } + + } + + public String toString() { + return "[waitingID=" + queueID + " status=" + status + " dynID=" + dynID + "]"; + } + + public int hashCode() { + + int hash = 1; + + hash = hash * 31 + queueID; + + hash += status; + + hash += dynID.hashCode(); + + return hash; + + } } \ No newline at end of file