Find a file
Aldy Hernandez 0c888665df Implement value/mask tracking for irange.
Integer ranges (irange) currently track known 0 bits.  We've wanted to
track known 1 bits for some time, and instead of tracking known 0 and
known 1's separately, it has been suggested we track a value/mask pair
similarly to what we do for CCP and RTL.  This patch implements such a
thing.

With this we now track a VALUE integer which are the known values, and
a MASK which tells us which bits contain meaningful information.  This
allows us to fix a handful of enhancement requests, such as PR107043
and PR107053.

There is a 4.48% performance penalty for VRP and 0.42% in overall
compilation for this entire patchset.  It is expected and in line
with the loss incurred when we started tracking known 0 bits.

This patch just provides the value/mask tracking support.  All the
nonzero users (range-op, IPA, CCP, etc), are still using the nonzero
nomenclature.  For that matter, this patch reimplements the nonzero
accessors with the value/mask functionality.  In follow-up patches I
will enhance these passes to use the value/mask information, and
fix the aforementioned PRs.

gcc/ChangeLog:

	* data-streamer-in.cc (streamer_read_value_range): Adjust for
	value/mask.
	* data-streamer-out.cc (streamer_write_vrange): Same.
	* range-op.cc (operator_cast::fold_range): Same.
	* value-range-pretty-print.cc
	(vrange_printer::print_irange_bitmasks): Same.
	* value-range-storage.cc (irange_storage::write_lengths_address):
	Same.
	(irange_storage::set_irange): Same.
	(irange_storage::get_irange): Same.
	(irange_storage::size): Same.
	(irange_storage::dump): Same.
	* value-range-storage.h: Same.
	* value-range.cc (debug): New.
	(irange_bitmask::dump): New.
	(add_vrange): Adjust for value/mask.
	(irange::operator=): Same.
	(irange::set): Same.
	(irange::verify_range): Same.
	(irange::operator==): Same.
	(irange::contains_p): Same.
	(irange::irange_single_pair_union): Same.
	(irange::union_): Same.
	(irange::intersect): Same.
	(irange::invert): Same.
	(irange::get_nonzero_bits_from_range): Rename to...
	(irange::get_bitmask_from_range): ...this.
	(irange::set_range_from_nonzero_bits): Rename to...
	(irange::set_range_from_bitmask): ...this.
	(irange::set_nonzero_bits): Rename to...
	(irange::update_bitmask): ...this.
	(irange::get_nonzero_bits): Rename to...
	(irange::get_bitmask): ...this.
	(irange::intersect_nonzero_bits): Rename to...
	(irange::intersect_bitmask): ...this.
	(irange::union_nonzero_bits): Rename to...
	(irange::union_bitmask): ...this.
	(irange_bitmask::verify_mask): New.
	* value-range.h (class irange_bitmask): New.
	(irange_bitmask::set_unknown): New.
	(irange_bitmask::unknown_p): New.
	(irange_bitmask::irange_bitmask): New.
	(irange_bitmask::get_precision): New.
	(irange_bitmask::get_nonzero_bits): New.
	(irange_bitmask::set_nonzero_bits): New.
	(irange_bitmask::operator==): New.
	(irange_bitmask::union_): New.
	(irange_bitmask::intersect): New.
	(class irange): Friend vrange_printer.
	(irange::varying_compatible_p): Adjust for bitmask.
	(irange::set_varying): Same.
	(irange::set_nonzero): Same.

gcc/testsuite/ChangeLog:

	* gcc.dg/tree-ssa/pr107009.c: Adjust irange dumping for
	value/mask changes.
	* gcc.dg/tree-ssa/vrp-unreachable.c: Same.
	* gcc.dg/tree-ssa/vrp122.c: Same.
2023-07-07 09:55:58 +02:00
c++tools Daily bump. 2023-06-23 00:16:38 +00:00
config Daily bump. 2022-11-15 08:32:29 +00:00
contrib Closing the GCC 10 branch 2023-07-07 09:11:46 +02:00
fixincludes Daily bump. 2023-06-16 00:17:18 +00:00
gcc Implement value/mask tracking for irange. 2023-07-07 09:55:58 +02:00
gnattools Daily bump. 2023-04-26 00:17:46 +00:00
gotools Daily bump. 2022-08-31 00:16:45 +00:00
include Daily bump. 2023-06-13 00:17:29 +00:00
INSTALL
intl Daily bump. 2023-06-16 00:17:18 +00:00
libada Update copyright years. 2023-01-16 11:52:17 +01:00
libatomic Daily bump. 2023-06-11 00:17:37 +00:00
libbacktrace Daily bump. 2023-03-29 00:17:01 +00:00
libcc1 Daily bump. 2023-05-19 00:17:43 +00:00
libcody Daily bump. 2023-06-16 00:17:18 +00:00
libcpp Daily bump. 2023-07-07 00:17:17 +00:00
libdecnumber Daily bump. 2023-06-16 00:17:18 +00:00
libffi Daily bump. 2023-05-07 00:16:40 +00:00
libgcc Daily bump. 2023-07-07 00:17:17 +00:00
libgfortran Daily bump. 2023-06-12 00:16:56 +00:00
libgm2 Daily bump. 2023-06-03 00:16:48 +00:00
libgo compiler, libgo: support bootstrapping gc compiler 2023-06-23 16:17:11 -07:00
libgomp Daily bump. 2023-06-23 00:16:38 +00:00
libiberty Daily bump. 2023-06-16 00:17:18 +00:00
libitm Daily bump. 2023-06-03 00:16:48 +00:00
libobjc Daily bump. 2023-05-23 00:17:11 +00:00
libphobos Daily bump. 2023-07-03 00:17:04 +00:00
libquadmath Daily bump. 2023-03-03 00:16:38 +00:00
libsanitizer Daily bump. 2023-05-01 00:16:44 +00:00
libssp Update copyright years. 2023-01-16 11:52:17 +01:00
libstdc++-v3 Daily bump. 2023-07-07 00:17:17 +00:00
libvtv Update copyright years. 2023-01-16 11:52:17 +01:00
lto-plugin Daily bump. 2023-07-01 00:18:32 +00:00
maintainer-scripts Closing the GCC 10 branch 2023-07-07 09:11:46 +02:00
zlib Daily bump. 2023-06-17 00:17:17 +00:00
.dir-locals.el
.gitattributes
.gitignore .gitignore: do not ignore config.h 2022-07-19 17:07:04 +03:00
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2023-07-01 00:18:32 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub config.sub: change mode to 755. 2021-12-21 09:10:57 +01:00
configure configure, Darwin: Ensure overrides to host-pie are passed to gcc configure. 2023-06-25 10:16:39 +01:00
configure.ac configure, Darwin: Ensure overrides to host-pie are passed to gcc configure. 2023-06-25 10:16:39 +01:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4 Generic configury support for shared libs on VxWorks 2022-10-11 07:31:07 +00:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS MAINTAINERS file: Added myself to Write After Approval and DCO 2023-06-30 16:04:48 +05:30
Makefile.def configure, Darwin: Ensure overrides to host-pie are passed to gcc configure. 2023-06-25 10:16:39 +01:00
Makefile.in Fix collection and processing of autoprofile data for target libs 2023-06-28 18:21:49 -07:00
Makefile.tpl Fix collection and processing of autoprofile data for target libs 2023-06-28 18:21:49 -07:00
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.