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.

OK?

gcc/ChangeLog:

        * ipa-prop.cc (ipcp_update_bits): Export value/mask known bits.
---
 gcc/ipa-prop.cc | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc
index d2b998f8af5..5d790ff1265 100644
--- a/gcc/ipa-prop.cc
+++ b/gcc/ipa-prop.cc
@@ -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
        {
-- 
2.40.1

Reply via email to