- if (act->is_rmw()) {
- act->set_type(ATOMIC_WRITE);
- } else if (act->get_reads_from()->is_free()) {
- removeAction(act);
- if (islastact) {
- fixupLastAct(act);
- }
- delete act;
- } else {
- const ModelAction *rel_fence =act->get_last_fence_release();
- if (rel_fence != NULL) {
- modelclock_t relfenceseq = rel_fence->get_seq_number();
- thread_id_t relfence_tid = rel_fence->get_tid();
- modelclock_t tid_clock = cvmin->getClock(relfence_tid);
- //Remove references to irrelevant release fences
- if (relfenceseq <= tid_clock)
- act->set_last_fence_release(NULL);
+ if (act->get_reads_from()->is_free()) {
+ if (act->is_rmw()) {
+ // Save the original action type
+ act->set_original_type(act->get_type());
+ act->set_type(ATOMIC_WRITE);
+ } else {
+ removeAction(act);
+ if (islastact) {
+ fixupLastAct(act);
+ }
+ if (act->get_func_ref_count() == 0) {
+ delete act;
+ continue;
+ }