simple changes:
authoryeom <yeom>
Thu, 21 Oct 2010 02:45:19 +0000 (02:45 +0000)
committeryeom <yeom>
Thu, 21 Oct 2010 02:45:19 +0000 (02:45 +0000)
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.

Robust/src/Analysis/OoOJava/ConflictGraph.java
Robust/src/Analysis/OoOJava/WaitingElement.java

index a7e07c934ee468107f79f90e59072c6ff1bfdf2b..09ea4687518ea36989740f1f4a951fc36cba1c8b 100644 (file)
@@ -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 &
index 35dc3b555f7a416f3f0ff0da2c331aa246dfaa90..0f1b4e54681d2df8f63a986184838c5684fb3bae 100644 (file)
 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<TempDescriptor> tempSet;
+
+  public WaitingElement() {
+    tempSet = new HashSet<TempDescriptor>();
+  }
+
+  public void addTempDesc(TempDescriptor tempDesc) {
+    tempSet.add(tempDesc);
+  }
+
+  public Set<TempDescriptor> 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