]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Export value/mask known bits from IPA.
authorAldy Hernandez <aldyh@redhat.com>
Fri, 14 Jul 2023 10:24:29 +0000 (12:24 +0200)
committerAldy Hernandez <aldyh@redhat.com>
Mon, 17 Jul 2023 10:03:36 +0000 (12:03 +0200)
Currently IPA 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:

* ipa-prop.cc (ipcp_update_bits): Export value/mask known bits.

gcc/ipa-prop.cc

index d2b998f8af573a931d12e7d78e9f5bfb2d78cd37..5d790ff12658be89854ff497e318601268b423ca 100644 (file)
@@ -5853,10 +5853,9 @@ ipcp_update_bits (struct cgraph_node *node, ipcp_transformation *ts)
        {
          unsigned prec = TYPE_PRECISION (TREE_TYPE (ddef));
          signop sgn = TYPE_SIGN (TREE_TYPE (ddef));
-
-         wide_int nonzero_bits = wide_int::from (bits[i]->mask, prec, UNSIGNED)
-                                 | wide_int::from (bits[i]->value, prec, sgn);
-         set_nonzero_bits (ddef, nonzero_bits);
+         wide_int mask = wide_int::from (bits[i]->mask, prec, UNSIGNED);
+         wide_int value = wide_int::from (bits[i]->value, prec, sgn);
+         set_bitmask (ddef, value, mask);
        }
       else
        {