Previously, we have used a special case in CycleGraph to delay detection
of a mo-cycle (actually, an RMW atomicity violation) long enough so that
a RMW can "reorder" across another RMW by passing its future value.
Unfortunately, this only works some of the time, as the execution
*may or may not* be a feasible prefix which allows the sending of the
future value.
Instead, we need to pull this special case out of CycleGraph and (in
subsequent commits) will add a more proper solution in model.cc.
if (fromnode->addEdge(tonode))
rollbackvector.push_back(fromnode);
-
- CycleNode *rmwnode = fromnode->getRMW();
-
/*
* If the fromnode has a rmwnode that is not the tonode, we should add
* an edge between its rmwnode and the tonode
- *
- * If tonode is also a rmw, don't do this check as the execution is
- * doomed and we'll catch the problem elsewhere, but we want to allow
- * for the possibility of sending to's write value to rmwnode
*/
- if (rmwnode != NULL && !to->is_rmw()) {
+ CycleNode *rmwnode = fromnode->getRMW();
+ if (rmwnode && rmwnode != tonode) {
if (!hasCycles)
hasCycles = checkReachable(tonode, rmwnode);