*confirm = NULL;
/* there might be several Confirms one after other that form an interval */
- for (; is_Confirm(n); n = get_Confirm_value(n)) {
+ for (;;) {
+ if (is_Minus(n) || is_Abs(n)) {
+ /* we can safely skip Minus and Abs when checking for != 0 */
+ n = get_unop_op(n);
+ continue;
+ }
+ if (! is_Confirm(n))
+ break;
+
/*
* Note: A Confirm is never after a Const. So,
* we simply can check the bound for being a Const
default:
break;
}
+ n = get_Confirm_value(n);
}
tv = value_of(n);
tarval *tv, *c;
ir_mode *mode;
pn_Cmp cmp, ncmp;
+ int negate = 1;
+ for (;;) {
+ ir_opcode code = get_irn_opcode(n);
+
+ switch (code) {
+ case iro_Minus:
+ negate *= -1;
+ n = get_Minus_op(n);
+ continue;
+ case iro_Confirm:
+ break;
+ default:
+ return value_classified_unknown;
+ }
+ break;
+ }
if (get_irn_op(n) != op_Confirm)
return value_classified_unknown;
return value_classified_unknown;
/* yep, negative */
- return value_classified_negative;
+ return value_classified_negative * negate;
case pn_Cmp_Ge:
/*
}
/* yep, positive */
- return value_classified_positive;
+ return value_classified_positive * negate;
default:
return value_classified_unknown;