It is sufficient to test, whether the zero bits equal the minimal value.
If they are all zero, the result is constant and this optimisation is unnecessary.
bitinfo const *const b = get_bitinfo(op);
ir_tarval *const min = get_mode_min(mode);
bitinfo const *const b = get_bitinfo(op);
ir_tarval *const min = get_mode_min(mode);
- if (tarval_is_all_one(tarval_or(min, tarval_not(b->z)))) {
DB((dbg, LEVEL_2, "%+F(%+F) is superfluous\n", irn, op));
exchange(irn, op);
env->modified = 1;
DB((dbg, LEVEL_2, "%+F(%+F) is superfluous\n", irn, op));
exchange(irn, op);
env->modified = 1;