fp-vrp: Simplify test when optimising Minus(x0...0).
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 5 Dec 2012 09:22:14 +0000 (10:22 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 5 Dec 2012 09:28:20 +0000 (10:28 +0100)
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.

ir/opt/fp-vrp.c

index 5a06aa5..f365ec2 100644 (file)
@@ -755,7 +755,7 @@ exchange_only:
                                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)))) {
+                               if (b->z == min) {
                                        DB((dbg, LEVEL_2, "%+F(%+F) is superfluous\n", irn, op));
                                        exchange(irn, op);
                                        env->modified = 1;