From: Aldy Hernandez Date: Fri, 14 Jul 2023 10:24:29 +0000 (+0200) Subject: Export value/mask known bits from IPA. X-Git-Tag: basepoints/gcc-15~7577 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64c727131133d8d2abf02ff4df5026749d9bd253;p=thirdparty%2Fgcc.git Export value/mask known bits from IPA. 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. --- diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index d2b998f8af57..5d790ff12658 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 {