From: Brian Norris Date: Wed, 5 Dec 2012 20:20:31 +0000 (-0800) Subject: model: stop thread-trace search once edge is added X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9bdbedb24f7c16c4941ec6b711fc8065e0cee9d3;p=c11tester.git model: stop thread-trace search once edge is added Once an edge has been added from 'act' to the current thread (or the 'rf' thread), we don't need to continue to search for more edges. --- diff --git a/model.cc b/model.cc index b73d31a5..715a2584 100644 --- a/model.cc +++ b/model.cc @@ -1517,18 +1517,21 @@ bool ModelChecker::r_modification_order(ModelAction *curr, const ModelAction *rf *act < *last_sc_fence_thread_local) { mo_graph->addEdge(act, rf); added = true; + break; } /* C++, Section 29.3 statement 4 */ else if (act->is_seqcst() && last_sc_fence_local && *act < *last_sc_fence_local) { mo_graph->addEdge(act, rf); added = true; + break; } /* C++, Section 29.3 statement 6 */ else if (last_sc_fence_thread_before && *act < *last_sc_fence_thread_before) { mo_graph->addEdge(act, rf); added = true; + break; } } @@ -1705,6 +1708,7 @@ bool ModelChecker::w_modification_order(ModelAction *curr) *act < *last_sc_fence_thread_before) { mo_graph->addEdge(act, curr); added = true; + break; } /*