From: Aldy Hernandez Date: Sun, 16 Jul 2023 18:48:29 +0000 (+0200) Subject: Export value/mask known bits from CCP. X-Git-Tag: basepoints/gcc-15~7574 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb9ba7047740e29c15dc5c75bcec784b4a917abf;p=thirdparty%2Fgcc.git Export value/mask known bits from CCP. 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. --- diff --git a/gcc/tree-ssa-ccp.cc b/gcc/tree-ssa-ccp.cc index 0d0f02a8442c..64d5fa813343 100644 --- a/gcc/tree-ssa-ccp.cc +++ b/gcc/tree-ssa-ccp.cc @@ -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); } }