class IncrementalSolver;
typedef unsigned int uint;
-enum EventType {LOAD, STORE, RMW, BRANCHDIR, MERGE, FUNCTION, THREADCREATE, THREADBEGIN, NONLOCALTRANS, LABEL,YIELD, THREADJOIN, LOOPENTER, LOOPSTART, ALLOC, EQUALS, FENCE};
+enum EventType {LOAD, STORE, RMW, BRANCHDIR, MERGE, FUNCTION, THREADCREATE, THREADBEGIN, NONLOCALTRANS, LOOPEXIT, LABEL,YIELD, THREADJOIN, LOOPENTER, LOOPSTART, ALLOC, EQUALS, FENCE};
typedef HashSet<EPRecord *, uintptr_t, 0, model_malloc, model_calloc, model_free> RecordSet;
typedef HSIterator<EPRecord *, uintptr_t, 0, model_malloc, model_calloc, model_free> RecordIterator;
typedef HashTable<EPRecord *, BranchRecord *, uintptr_t, 4, model_malloc, model_calloc, model_free> BranchTable;
if (record->getType()==NONLOCALTRANS) {
return;
}
+ if (record->getType()==LOOPEXIT) {
+ return;
+ }
if (record->getType()==BRANCHDIR) {
EPRecord *next=record->getNextRecord();
if (next != NULL)
Constraint * storeload=getOrderConstraint(store, rec);
Constraint * earlystoreload=getOrderConstraint(laststore, rec);
Constraint * c=new Constraint(IMPLIES, storeload, earlystoreload);
- ADDCONSTRAINT(c, "earylstore");
+ ADDCONSTRAINT(c, "earlystore");
}
if (lastload != NULL) {
Constraint * storeearlyload=getOrderConstraint(store, lastload);
Constraint * storeload=getOrderConstraint(store, rec);
Constraint * c=new Constraint(IMPLIES, storeearlyload, storeload);
- ADDCONSTRAINT(c, "earylload");
+ ADDCONSTRAINT(c, "earlyload");
}
lastload=rec;
}
recordExecCond(record);
insertBranch(record);
break;
+ case LOOPEXIT:
+ recordExecCond(record);
+ break;
case NONLOCALTRANS:
recordExecCond(record);
insertNonLocal(record);
if (record->getType()==NONLOCALTRANS) {
return;
}
+ if (record->getType()==LOOPEXIT) {
+ return;
+ }
if (record->getType()==BRANCHDIR) {
EPRecord *next=record->getNextRecord();
if (next != NULL)
return "yield";
case NONLOCALTRANS:
return "nonlocal";
+ case LOOPEXIT:
+ return "loopexit";
case LABEL:
return "label";
case LOOPENTER:
case YIELD:
case FENCE:
case NONLOCALTRANS:
+ case LOOPEXIT:
case LABEL:
case LOOPENTER:
case LOOPSTART:
dprintf(f,"}");
delete it;
}
- dprintf(f, "}");
execpoint->print(f);
if (!currexecpoint->directInLoop()) {
breakstate=getOrCreateCurrRecord(NONLOCALTRANS, NULL, 0, 0, 8, false);
currexecpoint->incrementTop();
+ } else {
+ breakstate=getOrCreateCurrRecord(LOOPEXIT, NULL, 0, 0, 8, false);
+ currexecpoint->incrementTop();
}
/* Get Last Record */
if (loopenter->getNextRecord()==NULL) {
loopenter->setNextRecord(labelrec);
}
- if (breakstate!=NULL) {
- breakstate->setNextRecord(labelrec);
- }
+ breakstate->setNextRecord(labelrec);
currexecpoint->incrementTop();
}
void neatPrint(EPRecord *r, ConstGen *cgen, bool *satsolution) {
- StoreLoadSet * sls=cgen->getStoreLoadSet(r);
r->print();
- model_print("address=%p ", sls->getAddressEncoding(cgen, r, satsolution));
switch(r->getType()) {
case LOAD: {
+ StoreLoadSet * sls=cgen->getStoreLoadSet(r);
+ model_print("address=%p ", sls->getAddressEncoding(cgen, r, satsolution));
model_print("rd=%lu ", sls->getValueEncoding(cgen, r, satsolution));
}
break;
case STORE: {
+ StoreLoadSet * sls=cgen->getStoreLoadSet(r);
+ model_print("address=%p ", sls->getAddressEncoding(cgen, r, satsolution));
model_print("wr=%lu ", sls->getValueEncoding(cgen, r, satsolution));
-
}
break;
case RMW: {
+ StoreLoadSet * sls=cgen->getStoreLoadSet(r);
+ model_print("address=%p ", sls->getAddressEncoding(cgen, r, satsolution));
model_print("rd=%lu ", sls->getRMWRValueEncoding(cgen, r, satsolution));
model_print("wr=%lu ", sls->getValueEncoding(cgen, r, satsolution));
}
+ break;
default:
;
}
}
//Now we have just memory operations, find the first one...make it go first
EPRecord *earliest=NULL;
-
for(uint index=0;index<threads.size();index++) {
EPRecord *record=threads[index];
#ifdef TSO
if (!stores[index]->empty()) {
record=stores[index]->front();
-
if (record!=NULL && (earliest==NULL ||
cg->getOrder(record, earliest, satsolution))) {
earliest=record;
break;
case NONLOCALTRANS:
break;
+ case LOOPEXIT:
+ break;
case LABEL:
break;
case YIELD: