X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=funcnode.cc;h=d328a4c5d24f6753fe0faf9338e153bc7284072a;hp=e08ca1b850f8a0f3239bdef7fd785677acbd0745;hb=70acabc306bc3014b3698e394908faf23a66a0b8;hpb=35ebf30f42f46d47fbec1db62acc453733dfb2e1 diff --git a/funcnode.cc b/funcnode.cc index e08ca1b8..d328a4c5 100644 --- a/funcnode.cc +++ b/funcnode.cc @@ -321,10 +321,9 @@ bool FuncNode::follow_branch(Predicate ** curr_pred, FuncInst * next_inst, Model if (branch->get_func_inst() != next_inst) continue; - /* check against predicate expressions */ + /* Check against predicate expressions */ bool predicate_correct = true; PredExprSet * pred_expressions = branch->get_pred_expressions(); - PredExprSetIter * pred_expr_it = pred_expressions->iterator(); /* Only read and rmw actions my have unset predicate expressions */ if (pred_expressions->getSize() == 0) { @@ -332,33 +331,26 @@ bool FuncNode::follow_branch(Predicate ** curr_pred, FuncInst * next_inst, Model unset_predicates->push_back(branch); } - while (pred_expr_it->hasNext()) { - pred_expr * pred_expression = pred_expr_it->next(); - uint64_t last_read, next_read; + SnapVector concrete_exprs = branch->evaluate(inst_act_map); + for (uint i = 0; i < concrete_exprs.size(); i++) { + struct concrete_pred_expr concrete = concrete_exprs[i]; + uint64_t next_read; bool equality; - switch(pred_expression->token) { + switch (concrete.token) { case NOPREDICATE: predicate_correct = true; break; case EQUALITY: - FuncInst * to_be_compared; - ModelAction * last_act; - - to_be_compared = pred_expression->func_inst; - last_act = inst_act_map->get(to_be_compared); - - last_read = last_act->get_reads_from_value(); next_read = next_act->get_reads_from_value(); - equality = (last_read == next_read); - if (equality != pred_expression->value) + equality = (next_read == concrete.value); + if (equality != concrete.equality) predicate_correct = false; - break; case NULLITY: next_read = next_act->get_reads_from_value(); equality = ((void*)next_read == NULL); - if (equality != pred_expression->value) + if (equality != concrete.equality) predicate_correct = false; break; default: