SCCelement = waitingElement;
}
}
-
if (SCCelement != null) {
// if there is at lease one SCC element, just enqueue SCC and
// ignore others.
for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext();) {
WaitingElement waitingElement = (WaitingElement) iterator.next();
SCCelement.addTempDesc(waitingElement.getTempDesc());
+ if(waitingElement!=SCCelement){
+ waitingElement.setBogus(true);
+ refinedSet.add(waitingElement);
+ }
}
}
refinedSet.add(SCCelement);
- } else if (numCoarse == 1 && (numRead + numWrite + numCoarse == total)) {
+ } else if (numCoarse == 1 && (numRead + numWrite == total)) {
// if one is a coarse, the othere are reads/write, enqueue SCC.
WaitingElement we = new WaitingElement();
we.setQueueID(queueID);
// 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());
+ if(waitingElement!=coarseElement){
+ coarseElement.addTempDesc(waitingElement.getTempDesc());
+ waitingElement.setBogus(true);
+ refinedSet.add(waitingElement);
+ }
}
}
refinedSet.add(coarseElement);
private int status;
private String dynID = "";
private TempDescriptor tempDesc;
+
+ // if scc/coarse represents more than one waiting elements
+ // ignored waiting element is inserted into a set of waiting element as a bogus element
+ private boolean bogus = false;
// a set of tempDescriptors:
// all associated with coarse conflicts for the same queue and the same sese
WaitingElement in = (WaitingElement) o;
- if (queueID == in.getQueueID() && status == in.getStatus() && dynID.equals(in.getDynID())) {
+ if (queueID == in.getQueueID() && status == in.getStatus() && dynID.equals(in.getDynID()) && tempDesc.equals(in.getTempDesc())) {
return true;
} else {
return false;
}
public String toString() {
- return "[waitingID=" + queueID + " status=" + status + " dynID=" + dynID + "]";
+ return "[waitingID=" + queueID + " status=" + status + " dynID=" + dynID + " td= "+tempDesc+" isBogus="+ bogus+"]";
}
public int hashCode() {
return hash;
}
+
+ public boolean isBogus(){
+ return bogus;
+ }
+
+ public void setBogus(boolean b){
+ bogus=b;
+ }
}
\ No newline at end of file
System.out.println(fm.getMethod()+"["+invars+"]");
Vector<Long> queuetovar=new Vector<Long>();
-
+
for(int i=0;i<invars.size();i++) {
TempDescriptor td=invars.get(i);
Set<Analysis.OoOJava.WaitingElement> weset=seseWaitingQueue.getWaitingElementSet(td);
- int numqueues=weset.size();
- output.println(" seseToIssue->rcrRecords["+i+"].flag="+numqueues+";");
- output.println(" seseToIssue->rcrRecords["+i+"].index=0;");
- output.println(" seseToIssue->rcrRecords["+i+"].next=NULL;");
- output.println(" int dispCount"+i+"=0;");
-
- for(Iterator<Analysis.OoOJava.WaitingElement> wtit=weset.iterator();wtit.hasNext();) {
- Analysis.OoOJava.WaitingElement waitingElement=wtit.next();
- int queueID=waitingElement.getQueueID();
- if (queueID>=queuetovar.size())
- queuetovar.setSize(queueID+1);
- Long l=queuetovar.get(queueID);
- long val=(l!=null)?l.longValue():0;
- val=val|(1<<i);
- queuetovar.set(queueID, new Long(val));
- }
+ int numqueues=0;
+ Set<Integer> queueSet=new HashSet<Integer>();
+ for (Iterator iterator = weset.iterator(); iterator.hasNext();) {
+ Analysis.OoOJava.WaitingElement we = (Analysis.OoOJava.WaitingElement) iterator.next();
+ Integer queueID=new Integer( we.getQueueID());
+ if(!queueSet.contains(queueID)){
+ numqueues++;
+ queueSet.add(queueID);
+ }
+ }
+ output.println(" seseToIssue->rcrRecords["+i+"].flag="+numqueues+";");
+ output.println(" seseToIssue->rcrRecords["+i+"].index=0;");
+ output.println(" seseToIssue->rcrRecords["+i+"].next=NULL;");
+ output.println(" int dispCount"+i+"=0;");
+
+ for (Iterator<Analysis.OoOJava.WaitingElement> wtit = weset.iterator(); wtit.hasNext();) {
+ Analysis.OoOJava.WaitingElement waitingElement = wtit.next();
+ int queueID = waitingElement.getQueueID();
+ if (queueID >= queuetovar.size())
+ queuetovar.setSize(queueID + 1);
+ Long l = queuetovar.get(queueID);
+ long val = (l != null) ? l.longValue() : 0;
+ val = val | (1 << i);
+ queuetovar.set(queueID, new Long(val));
+ }
}
HashSet generatedqueueentry=new HashSet();
for(int i=0;i<invars.size();i++) {
TempDescriptor td=invars.get(i);
Set<Analysis.OoOJava.WaitingElement> weset=seseWaitingQueue.getWaitingElementSet(td);
- int numqueues=weset.size();
for(Iterator<Analysis.OoOJava.WaitingElement> wtit=weset.iterator();wtit.hasNext();) {
Analysis.OoOJava.WaitingElement waitingElement=wtit.next();
int queueID=waitingElement.getQueueID();
+
+ if(waitingElement.isBogus()){
+ continue;
+ }
+
if (generatedqueueentry.contains(queueID))
continue;
else