]> gcc.gnu.org Git - gcc.git/commitdiff
Export value/mask known bits from CCP.
authorAldy Hernandez <aldyh@redhat.com>
Sun, 16 Jul 2023 18:48:29 +0000 (20:48 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 17 Jul 2023 11:56:25 +0000 (13:56 +0200)
Currently CCP throws away the known 1 bits because VRP and irange have
traditionally only had a way of tracking known 0s (set_nonzero_bits).
With the ability to keep all the known bits in the irange, we can now
save this between passes.

gcc/ChangeLog:

* tree-ssa-ccp.cc (ccp_finalize): Export value/mask known bits.

gcc/tree-ssa-ccp.cc

index 0d0f02a8442c65d2350510f0e10660d197186548..64d5fa813343fdb80b370eb7c7da7719cd5a7508 100644 (file)
@@ -1020,11 +1020,9 @@ ccp_finalize (bool nonzero_p)
       else
        {
          unsigned int precision = TYPE_PRECISION (TREE_TYPE (val->value));
-         wide_int nonzero_bits
-           = (wide_int::from (val->mask, precision, UNSIGNED)
-              | wi::to_wide (val->value));
-         nonzero_bits &= get_nonzero_bits (name);
-         set_nonzero_bits (name, nonzero_bits);
+         wide_int value = wi::to_wide (val->value);
+         wide_int mask = wide_int::from (val->mask, precision, UNSIGNED);
+         set_bitmask (name, value, mask);
        }
     }
 
This page took 0.063123 seconds and 5 git commands to generate.