+ * returns whether the cmp evaluates to true or false, or can't be evaluated!
+ * 1: true, 0: false, -1: can't evaluate
+ *
+ * @param env the environment
+ * @param cand the candidate node, either a Const or a Confirm
+ */
+static int eval_cmp(condeval_env_t *env, ir_node *cand) {
+ if (is_Const(cand)) {
+ tarval *tv_cand = get_Const_tarval(cand);
+ tarval *tv_cmp = get_Const_tarval(env->cnst);
+
+ return eval_cmp_tv(env->pnc, tv_cand, tv_cmp);
+ } else { /* a Confirm */
+ tarval *res = computed_value_Cmp_Confirm(env->cmp, cand, env->cnst, env->pnc);
+
+ if (res == tarval_bad)
+ return -1;
+ return res == tarval_b_true;
+ }
+}
+
+/**
+ * Check for Const or Confirm with Const.